Question: COMP 2001 CLASS ACTIVITY NESTED LOOPS Required: Write a plan for Python code based on the following instructions: i. Create an accumulator to store total
COMP 2001 CLASS ACTIVITY NESTED LOOPS Required: Write a plan for Python code based on the following instructions: i. Create an accumulator to store total average score of the class (class Tot.Avg). There are 4 students in the class. Also reme while loop. mber the loop accumulator if you are using a i. Set up a loop for the entire class (4 students); the loop will process 4 iterations representing each of the 4 students. Inside this loop, a. set up an accumulator inside the outer loop but outside the inner loop to help compute each student's total score (stdTotal) b. provide an input box for the user to enter student's name Create another loop that helps take in the student's scores in each of the 3 subjects and accumulates the total in order to find the average. For each student (in a loop), the system should: a. give the user the ability to enter the scores (out of 100%) in 3 subjects, b. accumulate the total score for this student (remember to set up the accumulator iii. for this outside the inner loop-studentTotalScore) Next, find the average score for the three subjects (outside the inner loop but inside the outer loop) a. print out the student's name, average score, and b. add the student's average score to the total of the total average score of the class Outside the outer loop, iv. v. compute the class overall average (overallClassAvg) by using the formula: classTotAvginumber of students in the class Print the class overall average (This should be done outside the outer (bigger) loop. a. b
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
