CH 6: Debug Files A high school is holding a recycling competition, and this program allows a user to enter a student's year in school (1 through 4) and number of cans collected for recycling. Data is entered continuously until the user enters 9 for the year. 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 collectedArray[SIZE] = 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 collectedArray[year] = collectedArray[year] + cans output "Enter year of student or ", QUIT, " to quit" input year endwhile output HEAD1 output HEAD2 year = 1 while year SIZE year = year + 1 endwhile stop

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
CH 6: Debug Files
A high school is holding a recycling competition, and this program allows a user to enter a
student's year in school (1 through 4) and number of cans collected for recycling. Data is entered
continuously until the user enters 9 for the year. 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 collectedArray[SIZE] = 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
collectedArray[year] = collectedArray[year] + cans
output "Enter year of student or ", QUIT, " to quit "
input year
endwhile
output HEAD1
output HEAD2
year = 1
while year < SIZE
year = year + 1
endwhile
stop
Transcribed Image Text:CH 6: Debug Files A high school is holding a recycling competition, and this program allows a user to enter a student's year in school (1 through 4) and number of cans collected for recycling. Data is entered continuously until the user enters 9 for the year. 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 collectedArray[SIZE] = 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 collectedArray[year] = collectedArray[year] + cans output "Enter year of student or ", QUIT, " to quit " input year endwhile output HEAD1 output HEAD2 year = 1 while year < SIZE year = year + 1 endwhile stop
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education

Expert Answers to Latest Homework Questions

Q: Please provide the correct answer to this financial accounting problem using valid calculations.
Q: please help with hw
Q: Can you explain this general accounting question using accurate calculation methods?
Q: I need help finding the accurate solution to this general accounting problem with valid methods.
Q: I am looking for help with this general accounting question using proper accounting standards.
Q: help me solve this hw
Q: Some people see art as a reflection of reality — like a mirror that shows something true about human…
Q: Can you solve this financial accounting problem using appropriate financial principles?
Q: Can you solve this general accounting problem with appropriate steps and explanations?
Q: Start by identifying a belief that feels true — something that seems reliable or meaningful in…
Q: I need help solving this financial accounting question with the proper methodology.
Q: help me solve this hw
Q: general accounting
Q: I’ve been thinking about how different philosophers view the idea of the “self.” Between Plato and…
Q: Please explain the solution to this financial accounting problem with accurate principles.
Q: Can you solve this general accounting question with accurate accounting calculations?
Q: I am looking for the correct answer to this financial accounting question with appropriate…
Q: Could you help me solve this financial accounting question using appropriate calculation techniques?
Q: General Accounting
Q: Please explain the correct approach for solving this general accounting question.
Q: I need assistance with this general accounting question using appropriate principles.