I am having problems using a value of zzzzzz as a sentinel. Here is my assignment:
"Write a program to process weekly employee time cards for all employees of an organization. Each employee will have three data items: the employee's name, the hourly wage rate, and the number of hours worked during a given week. Employees are to be paid time-and-a-half for all hours worked over 40. A tax amount of 3.625 percent of gross salary will be deducted. The program output should show each employee's name, gross pay, and net pay, and should also display the total net and gross amounts and their averages. Use zzzzzz as a sentinel value for name."
I have used sentinel values as int before but not char. I have looked all over the place for answers on this but no luck so far. Can someone point me in the right direction? Here is my code so far. The loop works i just can't get it to end.
You can't use != with char arrays. Use strings instead:
1 2 3 4 5 6 7 8 9 10
#include <string>
//...
// char EmployeeName[20]; // char array, blech
string EmployeeName; // string, much better
//...
while (EmployeeName != "zzzzzz"){ // now this will work