Question: Each code segment below starts with some comments ( lines that begin with two slashes ) that describe the program. Examine the pseudocode that follows
Each code segment below starts with some comments lines that begin with two
slashes that describe the program. Examine the pseudocode that follows the
introductory comments, then find and correct all the bugs as specified in the homework assignment instructions file.
A high school is holding a recycling competition, and this program allows a user to enter a student's year in school through and number of cans collected for recycling. Data is entered continuously until the user enters for the year. After headings, output is four lines one for each school year class.
start
Declarations
num year
num cans
num SIZE
num QUIT
num collectedArraySIZE
string HEAD "Can Recycling Report"
string HEAD "Year Cans Collected
output "Enter year of student or QUIT, to quit
output year
while year not QUIT
output "Enter number of cans collected
input cans
collectedArrayyear collectedArrayyear cans
output "Enter year of student or QUIT, to quit
output year
endwhile
output HEAD
and HEAD
year
while year SIZE
output year, collectedArrayyear
year year
end
end
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
