payroll program with loops
I deleted my last thread because I think it gave the impression that I was asking you to do my homework. I understand what i have to do, but I have one question. I am making a program that uses loops to output a list of employees, their employee number, pay, overtime etc. now this is what I have so far. I know that I can finish the prompt and output of the parameters, but I also need to give a total of all the employee's information at the end.
basically I prompt the user to enter the number of workers before the loop starts, then it will test the loop to see if it is not equal to zero and decrements the loop each time it is excecuted. the loop just asks for the information and outputs it. I replaced outfile with cin to test it. So far it is working, just need to finish it. What I don't know how to do is take the totals of the pay, overtime, and gross etc. and add them up to the output file. We are not covering objects yet so I am not sure if there is a way to get a total out of the loop.
for( ; Workers!=0 ; Workers--)
cout << "\nEnter the employees first and last name: ";
cin >> EmployeeFirstName >> EmployeeLastName;
cout << "Enter the Employee's work Number:";
cin >> EmployeeNumber;
cout << "Enter the number of Dependents: ";
cin >> Dependents;