Question: 1 . Draw a flowchart for the program that will let a teacher enter exactly 5 scores. The program will output the average score, highest

1. Draw a flowchart for the program that will let a teacher enter exactly 5 scores. The program
will output the average score, highest score, the number of passing scores (60 or above) and
the number of failing scores. You have to use an appropriate loop in your algorithm (for
or while?).
Hint: Use a box to store the highest score. Put -999 in this box at the beginning.
Test your algorithm using the following 2 cases in the table format below. You will end up
having 2 separate tables. Refer to page 5 in Lecture Notes: algorithms repetition.
Repetion# Score Score >=60 Total + Score Total Highest Pass Fail Avg
0,98,50,30,60
Outputs are
47.6(average)
98(highest)
2(passing scores)
3(failing sores)
0,0,0,0,0
Outputs are
0(average)
0(highest)
0(passing scores)
5(failing sores)
2. Give your answer to the following question. In the above algorithm, what would happen if
you put 100 in highest at the beginning instead of -999? Will your algorithm still work?
Why do you think I suggested you put -999 in highest at the beginning?

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 Programming Questions!