a. Write a program segment to input data into the arrays declared in Program Segment B b. Write a program segment to calculate salary for each worker and print their worker ID number and salary.
TP Company has 100 workers. Every worker is paid based on the numbers
of working hours and their positions as shown in Table 2. A declaration of workers
information is shown in Program Segment B. By referring to this declaration, answer
question a and b.
Table 2: Working hour rate with position respectively
Position Rate/hour
Supervisor (S) 20/hour
Assistant Supervisor (A) 15/hour
Operator (O) 8/hour
const int SIZE 100;
string worker_ID[SIZE];
char worker_position[SIZE];
int working_hour[SIZE];
float salary[SIZE];
Program Segment B
a. Write a program segment to input data into the arrays declared in Program
Segment B
b. Write a program segment to calculate salary for each worker and print their worker
ID number and salary.
Step by step
Solved in 3 steps