(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

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

(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 programAll 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 programAverage each row to get the average scores of each program for last monthAverage 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

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY