Question: Pseudo-code for Exercise 4 (Partial)1. const int ASSIGNMENT_NUM = 2, SET_NUM = 5; 2. double val[ASSIGNMENT_NUM][SET_NUM]; 3. Input the HW assignments:cout for (int i =

 Pseudo-code for Exercise 4 (Partial)1. const int ASSIGNMENT_NUM = 2, SET_NUM

Pseudo-code for Exercise 4 (Partial)1. const int ASSIGNMENT_NUM = 2, SET_NUM = 5;

2. double val[ASSIGNMENT_NUM][SET_NUM];

3. Input the HW assignments:cout

for (int i = 0; i

cin >> val[0][i];}

4. Find the best HW scores:double hw_best = 0;

for (int i = 0; i

if (val[0][i] > hw_best){hw_best = val[0][i];}Find the intermediate worst HW score ...Find the intermediate average HW score ...}

5. Continue ...

Algorithm for Exercise 4

1. Declare a two dimensional double array val[2][5]. Val[0][] is used to store HW assignments and val[1][] is used to store exams.a. Alternatively, since we need to store the best, worst, and average scores on each component, we can extend the width of the array as val[[2][8] so we can use val[0][5], val[0][6], val[0][7] to store the best, worst, and average HW, respectively, and so on.

2. Loop for five times and input the HW assignment to the val[0][].

3. Loop for five times and input the Labs to the val[1][].

4. Declare three double variables for HW best, worst, and average; and three double variables for Lab best, worst, and average. If you declare val[2][8] as in 1.a, skip this step.

5. Find the best, worst, and averages of HW and Labs.a. Find the best: iterate the five scores by comparing each with the variable best. If greater than the best, update best to be the current HW assignment.b. Find the worst: similar but change greater to be smaller as in step 5.ac. Find the average: add the five scores and divide the sum by five.

6. Declare a double variable for overall grade. Calculate the overall grade by averaging the two averages of the two sets of the scores.

7. Declare a bool variable is_passed. If both averages (HWs and Labs) are equal or above 50, then is_passed is set to true. Otherwise, it is false.

8. Output the scores in the format specified.

Write a program that asks a student for his/her grades assessing his/her C++ programming skills. The student gets a separate grade for each homework assignment and the lab exam associated with it. In order for the student to pass the class, he/she needs to achieve 50% or better in all possible dimensions, i.e., >= 50% average in homework assignments >= 50% average in lab exams Assume that the student has been given 5 sets of homework assignments and lab exams, respectively, and that the scores are given in percentages. The program should get input from the screen and do the following: a) Calculate the best, worst, and average grades for each of the two components (hw assignments and lab exams). b) Calculate the overall grade of the student with every component carries the same weight c) Decide whether the student passes the class or not. If the student cannot pass the class, the program should output the reason why. d) Output on the screen the input and results so that they look similar to this :- (Doesn't have to look exactly similar like this but expected to cover all the values at least.) (use appropriate tools for formatting I/O): 1 2 3 4 5 BEST WORST AVG HW LAB 100.00 90.00 100.00 100.00 80.00 100.00 100.00 100.00 70.00 60.00 90.00 100.00 80.00 60.00 94.00 84.00 AVG 100.00 95.00 75.00 80.00 95.00 Overall: 89 (option 1) Congratulations! You passed the class! (option 2) I'm sorry to inform you that you failed the class, because your performance in was

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!