Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Do not remove the questions or text from the Template. Mark any additions to the pseudocode by adding lines and showing them in red. Strikeout
Do not remove the questions or text from the Template. Mark any additions to the pseudocode by adding lines and showing them in red. Strikeout any deletions using the strikeout tool. Assume that the pseudocode below for each question is a separate working program in your organization and that it needs modifications as described in the comments lines that begin with two slashesat the beginning of the code. Your job is to alter the pseudocode to meet the new specifications as noted above. Please follow directions as specified in the homework assignment instructions file. NOTE: If a function has no changes to be made to itthen it will be in blue font.
Find the Bugs
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.
This program is supposed to display every fifth year starting
with ; that is and so on for
years.
start
Declarations
num year
num STARTYEAR
num FACTOR
num ENDYEAR
year STARTYEAR
while year ENDYEAR
output year
end
stop
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started