Pseudocode ONLY . Watson Elementary School contains 30 classrooms (1 – 30). Each
ID: 3759109 • Letter: P
Question
Pseudocode ONLY.
Watson Elementary School contains 30 classrooms (1 – 30). Each classroom can have up to 35 students (0 – 35). Each student takes an achievement test at the end of the school year and receives a score from 0 – 100. The class(es) with the highest (accumulated) scores receive(s) a prize.
Write a program that iterates through each of the classrooms, prompts for the total number of students in the classroom and a score for each student, and accumulates the scores for each classroom.
Validation on the classroom, students, and scores is a must. If a classroom enters invalid data, that classroom is disqualified.
Once all of the scores have been entered, display the accumulated scores for each classroom (or that they have been DQ'd) so the winner can be identified.
Explanation / Answer
Start
num stuID
num classNum
num score
num SIZE = 30
num totalPnts[SIZE] = 0
get stuID, classNum, score
while not eof
if classNum >= 1 AND classNum <= SIZE then
totalPnts[classNum – 1] = totalPnts[classNum – 1] + score
else
print “invalid classroom number”
endif
classNum = classNum + 1
endwhile
Stop
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.