How Do I Complete Pseudocode for Classroom Score Calculations?

In summary, the conversation discusses a basic programming class and the materials used for it. The student needs help with a question that involves creating a program to calculate test scores for each classroom. The conversation also mentions confusion with completing the pseudocode and attaching files. The expert suggests dropping a line of code and completing the pseudocode for step 2. The student also asks about the relevance of BASIC programming to physics.
  • #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.
 
Physics news on Phys.org
  • #2
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.
 
  • #3
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?
 
  • #4
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:
  • #5
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

  • CIT 111 - Chapter 6 - Arrays - Exercise 5a - Flowchart.pdf
    21 KB · Views: 531
  • CIT 111 - Chapter 6 - Arrays - Exercise 5a & 5b.doc
    30 KB · Views: 572
  • #6
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?
 
  • #7
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.
 
  • #8
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.
 
  • #9
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.
 

1. What is programming?

Programming is the process of creating instructions for a computer to execute in order to solve a problem or perform a task.

2. What are the basic components of a programming language?

The basic components of a programming language include syntax, data types, variables, control structures, and functions.

3. How do I write a simple program?

To write a simple program, you need to choose a programming language, learn its syntax and basic components, and then use a code editor to write your program according to the language's rules and guidelines.

4. What is a variable?

A variable is a named storage location in a program that holds a value, which can be changed or manipulated during the program's execution.

5. How do I debug my program?

To debug a program, you can use a debugger tool provided by your code editor or programming language, or you can use print statements to track the flow of your program and identify any errors.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
1
Views
6K
  • Engineering and Comp Sci Homework Help
Replies
7
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
2K
  • Programming and Computer Science
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
2K
  • Programming and Computer Science
Replies
4
Views
3K
  • Programming and Computer Science
Replies
1
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
2K
Back
Top