/* payroll program */ #include using namespace std; int main() { int id; //employee id double hours,rate,pay; int numemp = 0; //count the employees cout << "Please enter an ID (enter -1 to stop): "; cin >> id; //read ID while (id != -1) { //check for fake ID cout << "Please enter the hours worked: "; cin >> hours; //read hours worked cout << "Please enter the rate of pay: "; cin >> rate; //read rate of pay pay = hours * rate; //calculate pay cout << "Employee " << id << " worked " << hours << " hours at a rate of pay of $" << rate << " earning $" << pay << endl << endl; numemp++; //increment counter cout << "Please enter an ID (enter -1 to stop): "; cin >> id; //read new ID } cout << "\nWe have processed " << numemp << " employees" << endl; // system("pause"); //un-comment when using DevC++ return 0; }