- #1
ksweeper21
- 3
- 0
I am taking a very basic programming class, and all we work with is fliowcharts and pseudocode. We use the following book: Programming Logic and Design, 5th edition, comprehensive by Joyce Farrell. We use VISIO for the flowcharts, and Word for the pseudocode. And I need help with the following question:
5a. Watson Elementary School contains 30 classrooms numbered 1 through 30. Each classroom can contain any number of students up to 35. Each student takes an achievement test at the end of the school year and receives a score from 0 through 100. Write a program that accepts data for each student in the school---student ID, classroom number, and score on the acievement test.
Design a program that lists the total points scored for each of the 30 classrooms.
I have completed the flowchart for this part, but I got confused when trying to finish the pseudocode. Here is my pseudocode for part 5a.
It won't let me upload the files here, so I will post my pseudocode for part 5a (what I have of it) and if you need to see the flowchart, email me at the email address below, or tell me how to attach it!
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
get stuID, classNum, score (GOT LOST RIGHT HERE)
classNum = classNum + 1
endwhile
Stop
The gap between get stuID, classNum, score and classNum = classNum + 1 is where the rest of the pseudocode goes, but I got lost.
5b. Modify Exercise 5a to that each classroom's average of the test scores prints, rather than each classroom's total.
I need both flowchart and pseudocode for this part.
Any help will be greatly appreciated. Please email me at ksweeper21@gmail.com. Thank you.
5a. Watson Elementary School contains 30 classrooms numbered 1 through 30. Each classroom can contain any number of students up to 35. Each student takes an achievement test at the end of the school year and receives a score from 0 through 100. Write a program that accepts data for each student in the school---student ID, classroom number, and score on the acievement test.
Design a program that lists the total points scored for each of the 30 classrooms.
I have completed the flowchart for this part, but I got confused when trying to finish the pseudocode. Here is my pseudocode for part 5a.
It won't let me upload the files here, so I will post my pseudocode for part 5a (what I have of it) and if you need to see the flowchart, email me at the email address below, or tell me how to attach it!
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
get stuID, classNum, score (GOT LOST RIGHT HERE)
classNum = classNum + 1
endwhile
Stop
The gap between get stuID, classNum, score and classNum = classNum + 1 is where the rest of the pseudocode goes, but I got lost.
5b. Modify Exercise 5a to that each classroom's average of the test scores prints, rather than each classroom's total.
I need both flowchart and pseudocode for this part.
Any help will be greatly appreciated. Please email me at ksweeper21@gmail.com. Thank you.