Electrical and Computer Engineering
11
UAH
CPE 112
Payroll Program (continued)
•  cout << “Enter employee number: ”; // Prompt
•  cin >> empNum; // Read employee id no.
•  while (empNum != 0) // While employee
•  { // number isn’t zero
– cout << “Enter pay rate: ”; // Prompt
– cin >> payRate;         // Read hourly pay rate
– cout << “Enter Hours worked: ”;  // Prompt
– cin >> hours; // Read hours worked
•   CalcPay(payRate, hours, wages);  // Compute wages
•     total = total + wages; // Add wages to total          
•     payFile << empNum << payRage // Put results in file
•           << hours << wages;
•   cout << “Enter employee number: ”;  //Prompt
•   cin >> empNum; // Read ID number
•  }
•  cout << “Total payroll is ”  // Print total payroll
•       << total << endl; //  on screen
•  return 0; // Indicate successful
•} //  completion