
(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 nowThis is a popular solution!
Step by stepSolved in 2 steps with 1 images

- Question 3 : (Eliminate duplicates) Write a program Duplicate.java that reads in ten integers in an array T, creates a new array V by eliminating the duplicate values in the array, and displays the result. Here is the sample run of the program: Enter ten numbers: 1 2 3 2 1 6 3 4 5 2 The distinct numbers are: 1 2 3 6 4 5arrow_forwardExercise 1: (Design of algorithm to find greatest common divisor) In mathematics, the greatest common divisor (gcd) of two or more integers is the largest positive integer that divides each of the integers. For example, the gcd of 8 and 12 is 4. Why? Divisors of 8 are 1, 2, 4, 8. Divisors of 12 are 1, 2, 4, 6, 12 Thus, the common divisors of 8 and 12 are 1, 2, 4. Out of these common divisors, the greatest one is 4. Therefore, the greatest common divisor (gcd) of 8 and 12 is 4. Write a programming code for a function FindGCD(m,n) that find the greatest common divisor. You can use any language of Java/C++/Python/Octave. Find GCD Algorithm: Step 1 Make an array to store common divisors of two integers m, n. Step 2 Check all the integers from 1 to minimun(m,n) whether they divide both m, n. If yes, add it to the array. Step 3 Return the maximum number in the array.arrow_forward1- Write a user-defined function that accepts an array of integers. The function should generate the percentage each value in the array is of the total of all array values. Store the % value in another array. That array should also be declared as a formal parameter of the function. 2- In the main function, create a prompt that asks the user for inputs to the array. Ask the user to enter up to 20 values, and type -1 when done. (-1 is the sentinel value). It marks the end of the array. A user can put in any number of variables up to 20 (20 is the size of the array, it could be partially filled). 3- Display a table like the following example, showing each data value and what percentage each value is of the total of all array values. Do this by invoking the function in part 1.arrow_forward
- Warning ⚠️ Don't post AI generated answer or plagiarised answer. If I see these things I'll give you multiple downvotes and will report immediately.arrow_forwardAnswer The following a. Write the statement to declare an integer array alpha of size 95. b. Write the statement to initialize the array alpha to 0. c. What is the valid index range of alpha? d. Assign 20 to the fourth component of the array alpha. (Remember the array index starts at 0) e. Write the statement to print the values of the array alpha one per line. explain pleasearrow_forwardcreate code, no if or return on it.arrow_forward
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY





