How Do I Complete Pseudocode for Classroom Score Calculations?

AI Thread Summary
The discussion focuses on completing pseudocode for calculating classroom scores at Watson Elementary School, where each classroom can have up to 35 students taking an achievement test. The user has created a flowchart but is struggling with the pseudocode, particularly in the section where student data is collected and processed. Key points include the need to iterate through student data for total points and later for averages, with a correction noted that the line for incrementing classroom numbers is misplaced. Suggestions for file format compatibility for flowchart sharing were also discussed, emphasizing the importance of completing both steps of the program. Assistance is requested for both the pseudocode and flowchart for the second part of the assignment.
ksweeper21
Messages
3
Reaction score
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.
 
Physics news on Phys.org
Your program will have TWO steps. Step one will collate all the data by iterating through the student data.

ONCE THAT IS DONE, step 2 will iterate through the classroom array and print them out.

You have completed step 1 - there is no missing code. But there is one change required: drop the classNum = classNum + 1. You will not iterate through the classes in the first step, only in the second.
 
When my instructor went over the problem, that part of the pseudocode was included, and other people in the class said I was missing the end of the pseudocode.

I would like to post my flowchart for part 5a, but the file type is not allowed. Any suggestions?
 
ksweeper21 said:
When my instructor went over the problem, that part of the pseudocode was included
Well, there are many ways of solving a given problem. I don't know what his way is. It is true, your program will end with that line, but it is currently in the wrong place.

ksweeper21 said:
and other people in the class said I was missing the end of the pseudocode.
Correct. You still have step 2 to do.

ksweeper21 said:
I would like to post my flowchart for part 5a, but the file type is not allowed. Any suggestions?
Your flowcharting program will probably have an option to export to GIF or BMP.
 
Last edited:
Alright, Here is my flowchart for part 5a. and the pseudocode for part 5a again, just in case.


I really need help with at least the flowchart or pseudocode for part 5b.


Thank you very much.
 

Attachments

ksweeper21 said:
Alright, Here is my flowchart for part 5a. and the pseudocode for part 5a again, just in case.


I really need help with at least the flowchart or pseudocode for part 5b.


Thank you very much.

Attachments are still pending approval.

Have you studied my suggestions and made any progress?
 
ksweeper21 said:
Alright, Here is my flowchart for part 5a. and the pseudocode for part 5a again, just in case.


I really need help with at least the flowchart or pseudocode for part 5b.


Thank you very much.

Please avoid posting in DOC format -- there are issues with macros and such. PDF format is preferred. Thanks.
 
ksweeper21 said:
Alright, Here is my flowchart for part 5a. and the pseudocode for part 5a again, just in case.


I really need help with at least the flowchart or pseudocode for part 5b.


Thank you very much.
OK. The flowchart is incomplete.

As I said previously:
1] So far you've only done step 1 - data collation. You haven't done step 2 - output.
2] The classnum = classnum + 1 is out of place. It has no place in step 1 but will be needed in step 2.
 
Hold on.
Is there any relevance of BASIC programming to physics.
 
  • #10
jollyPHYSICS said:
Hold on.
Is there any relevance of BASIC programming to physics.

This thread is over a year old and the OP hasn't been back here since then.

Programming can be very relevant to physics, just as with most other fields such as engineering. Not sure about basic though.
 
Back
Top