(Evaluation of Trainees) Use a two-dimensional array to solve the following problem: A company has four trainees (1 to 4) who take five different programs (1 to 5). Once a week, the trainer creates evaluation results for each program taken. Each result contains the following: a. The trainee number b. The program number c. The score of that program taken that week (0 to 10 scores) Thus, the trainer creates 5 results per week for each trainee. Assume that the information from all the results for last month is available. Write an application that will read all this information for last month’s results and summarize the total scores by the trainee and by the program. All totals should be stored in the two-dimensional array. After processing all the information for last month, display the results in tabular format, with each column representing a trainee an each row representing a particular program. Average each row to get the average scores of each program for last month. Average each column to get the average scores by the trainee for last month. Your output should include these row averages and column averages to the right of the totalled rows and to the bottom of the totalled columns, respectively. Here is a sample run: Enter the trainee number (-1 to end): 1 Enter the program number: 2 Enter the score of that program taken that week (0 to 10): 5.5 Enter the trainee number (-1 to end): 1 Enter the program number: 3 Enter the score of that program taken that week (0 to 10): 8 Enter the trainee number (-1 to end): 2 Enter the program number: 2 Enter the score of that program taken that week (0 to 10): 8 Enter the trainee number (-1 to end): 4 Enter the program number: 4 Enter the score of that program taken that week (0 to 10): 6 Enter the trainee number (-1 to end): 2 Enter the program number: 1 Enter the score of that program taken that week (0 to 10): 5 Enter the trainee number (-1 to end): -1 Program Trainee 1 Trainee 2 Trainee 3 Trainee 4 Trainee 5 Average 1 0 5 0 0 0 1 2 5.5 8 0 0 0 2.7 3 8 0 0 0 0 1.6 4 0 0 0 6 0 1.2 Average 3.375 3.25 0 1.5 0
(Evaluation of Trainees) Use a two-dimensional array to solve the following problem: A company has four trainees (1 to 4) who take five different programs (1 to 5). Once a week, the trainer creates evaluation results for each
a. The trainee number
b. The program number
c. The score of that program taken that week (0 to 10 scores)
Thus, the trainer creates 5 results per week for each trainee. Assume that the information from all the results for last month is available. Write an application that will read all this information for last month’s results and summarize the total scores by the trainee and by the program. All totals should be stored in the two-dimensional array. After processing all the information for last month, display the results in tabular format, with each column representing a trainee an each row representing a particular program. Average each row to get the average scores of each program for last month. Average each column to get the average scores by the trainee for last month. Your output should include these row averages and column averages to the right of the totalled rows and to the bottom of the totalled columns, respectively.
Here is a sample run:
Enter the trainee number (-1 to end): 1
Enter the program number: 2
Enter the score of that program taken that week (0 to 10): 5.5
Enter the trainee number (-1 to end): 1
Enter the program number: 3
Enter the score of that program taken that week (0 to 10): 8
Enter the trainee number (-1 to end): 2
Enter the program number: 2
Enter the score of that program taken that week (0 to 10): 8
Enter the trainee number (-1 to end): 4
Enter the program number: 4
Enter the score of that program taken that week (0 to 10): 6
Enter the trainee number (-1 to end): 2
Enter the program number: 1
Enter the score of that program taken that week (0 to 10): 5
Enter the trainee number (-1 to end): -1
Program Trainee 1 Trainee 2 Trainee 3 Trainee 4 Trainee 5 Average
1 0 5 0 0 0 1
2 5.5 8 0 0 0 2.7
3 8 0 0 0 0 1.6
4 0 0 0 6 0 1.2
Average 3.375 3.25 0 1.5 0
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images