You are viewing our Forum Archives. To view or take place in current topics click here.
Pseudocode help please?
Posted:

Pseudocode help please?Posted:

nirragnik
  • Challenger
Status: Offline
Joined: Aug 01, 201013Year Member
Posts: 196
Reputation Power: 7
Status: Offline
Joined: Aug 01, 201013Year Member
Posts: 196
Reputation Power: 7
I'm so stuck in my class Principles of Computer Programming. I've tried so hard to figure just this simple debugging practice. If you have been through COMP175 or know much about pseudocode if you could help me please that would be appreciated. My aim is nirragnik

Here is the code...

// A high school is holding a recycling competition
// This program allows a user to enter a student's
// year in school (1 through 4)
// and number of cans collected
// Data is entered continuously until the user wnats to quit
// After headings, output is four lines
// one for each school year class
start
Declarations
num year
num cans
num SIZE = 4
num QUIT = 9
num collected[SIZE] = 0, 0, 0, 0
string HEAD1 = "Can Recycling Report"
string HEAD2 = "Year Cans Collected"
output "Enter year of student or ", QUIT, " to quit "
input year
while year <> QUIT
output "Enter number of cans collected "
input cans
collected[year] = collected[year] + cans
endwhile
output HEAD1
output HEAD2
while year <= SIZE
output year, collected[year - 1]
year = year + 1
endwhile
stop
#2. Posted:
-Jordan-
  • TTG Addict
Status: Offline
Joined: Jul 12, 201013Year Member
Posts: 2,684
Reputation Power: 122
Status: Offline
Joined: Jul 12, 201013Year Member
Posts: 2,684
Reputation Power: 122
Pseudo code is just fake code which outlines what the program is going to do. For example...


Make integers; num1, num2, num3

Get input for num1

Get input for num2

Add num1 and num2

Store result in num3

Display num3


Not sure what your tutor is teaching you this for. If you're in the UK and doing the BTEC ND in Software Dev then you should be doing C++ in that module.
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.