i have a for loop where i use an object to input information like this:
I want the emp objects to increase as the loop goes around. so for each time to loop goes around i need it to go from emp1 to emp2 to emp3 up to max of 3. how would i go about doing this. thank you in advance
Code://Defines employee objects EmployeeClass emp1; EmployeeClass emp2; EmployeeClass emp3; //displays output so user can input information cout << "\nWelcome to the Employee Pay Center\n\n" ; for(int i = 0; i <= max; i++) //asking for information for employee 1 cout << "Enter the employee name = "; cin >> emp1.EmployeeName; cout << "Enter the hours worked = "; cin >> emp1.hours; cout << "Enter his or her hourly wage = "; cin >> emp1.wage; cout << endl;




Reply With Quote