Answered step by step
Verified Expert Solution
Link Copied!

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 slashes)at 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 it,then 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 2017; that is,2017,2022,2027,2032, and so on, for 30
// years.
start
Declarations
num year
num START_YEAR =2017
num FACTOR =5
num END_YEAR
year = START_YEAR
while year < END_YEAR
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(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 =0
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 "
output year
while year not QUIT
output "Enter number of cans collected "
input cans
collectedArray[year]= collectedArray[year]+ cans
output "Enter year of student or ", QUIT, " to quit "
output year
endwhile
output HEAD1
and HEAD2
year =1
while year < SIZE
output year, collectedArray[year]
year = year +1
end
end

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Big Data Concepts, Theories, And Applications

Authors: Shui Yu, Song Guo

1st Edition

3319277634, 9783319277639

More Books

Students also viewed these Databases questions

Question

Name some common financial problems with which planners deal with?

Answered: 1 week ago