How do I get it to show the individual numbers in empId when requesting the hours worked and the hourly wage? Also, how would I make it display their ID numbers with their total wage earnings at the end? And how do I get it not to accept negative numbers for hours or a hourly wage less than $6.00?
How do I get it to show the individual numbers in empId when requesting the hours worked and the hourly wage?
You just need to loop through each element in the "workers" array using workers[index].
1 2 3 4 5 6 7 8
for (int index = 0; index < empId; index++)
{
cout << "Please enter the hours worked by employee number " << (index+1) << " (ID = " << workers[index] << ") : ";
cin >> hours[index];
cout << "Please enter the pay rate for employee number "<< (index+1) << " (ID = " << workers[index] << ") : ";
cin >> payRate[index];
}
Also, how would I make it display their ID numbers with their total wage earnings at the end?
Same thing as above.
And how do I get it not to accept negative numbers for hours or a hourly wage less than $6.00?
You would need some sort of loop to repeat until the user enters the correct response.