3

# Find Bugs in the pseudocode // 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

## Question

###### Find Bugs in the pseudocode // 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
Find Bugs in the pseudocode

// 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
while year <= SIZE
output year, collected[year - 1]
year = year + 1
endwhile
stop

DEBUG06-02.txt

// Program lets user input scores on four tests
// Average is computed and letter grade is determined
// Letter grades are based on 90 for an A, 80 for a B, and so on
start
string name
num score
num NUM_TESTS = 4
num NUM_RANGES = 5
num RANGES[NUM_RANGES] = 90, 80, 70, 60, 0
num QUIT = "ZZZZZ"
string GRADES[NUM_RANGES] = "A", "B", "C", "D", "F"
num total
num average
num sub
output "Enter student name or ", QUIT, " to quit "
input name
while name <> QUIT
sub = 0
while sub < NUM_TESTS
output "Enter score "
input score
total = total + score
endwhile
average = total / NUM_TESTS
sub = 0
while average < RANGES[NUM_TESTS]
sub = sub + 1
endwhile
output "Enter student name or ", QUIT, " to quit "
input name
endwhile
stop

DEBUG06-03.txt

// This program counts how many sales are made in each of 5 categories of products
start
Declarations
num category
num SIZE = 5
num QUIT = 9
num sales[SIZE] = 0, 0, 0, 0, 0
string HEAD2 = "Category Number of Sales"
output "Enter category ", QUIT, " to quit "
input category
while category = QUIT
if category >= 1 AND category < SIZE then
sales[category + 1] = sales[category - 1] + 1
else
output "Invalid category"
endif
output "Enter category ", QUIT, " to quit "
input category
endif
category = 0
while category <= SIZE
output category + 1, sales[category]
category = category + 1
endwhile
stop

#### Similar Solved Questions

##### Acceleration
The fastest measured pitched baseball left the pitcher's hand at a speed of 44.0 . If the pitcher was in contact with the ball over a distance of 1.50 and producedconstant acceleration,...
##### Suppose you're currently producing at letter "C," and your Society is located along Production Possibilities...
Suppose you're currently producing at letter "C," and your Society is located along Production Possibilities Curve #3. This means (pick one) (a) Your society can produce more of both bread & smart phones.   (b) Your society can produce more bread but only if it...
##### A single card was picked at random from a standard deck. There are 52 cards in...
A single card was picked at random from a standard deck. There are 52 cards in a standard deck. Express your answer as reduced fractions. The probability that the card is a spade or a 2. The probability that the card is a red Q....
##### Pastina Company sells various types of pasta to grocery chains as private label brands. The company's...
Pastina Company sells various types of pasta to grocery chains as private label brands. The company's reporting year-end is December 31. The unadjusted trial balance as of December 31, 2021, appears below. Credits Debits 35,500 43,000 3,000 63,000 23,000 2,500 9,000 92,000 34,500 34,000 53,000...
##### Describes the importance of leadership in healthcare with an overarching idea
describes the importance of leadership in healthcare with an overarching idea...
##### Question 3 (30 marks) A- The following transactions occurred between the home office and the Mason...
Question 3 (30 marks) A- The following transactions occurred between the home office and the Mason Branch of Smaldino Company: Cash of $1,000 was forwarded by the home office to Mason Branch. Merchandise with a home office cost of$60,000 was shipped by the home office to Mason Branch. Equipment ...
##### Inding examples of the reed along the banik of a nver in Southem Caltormia and measuring...
inding examples of the reed along the banik of a nver in Southem Caltormia and measuring the distan between these quanthes A portion of the data which was collected s provided below mere is a linear resationship 16 4.41 114 36 125 299 146 2 82 18 2 223 263...
Lambda Computer Products competed for and won a contract to produce two prototype units of a new type of computer that is based on laser optics rather than on electronic binary bits. The first unit produced by Lambda took 5,000 hours to produce and required $250,000 worth of material, equipment usag... 1 answers ##### If a patient is prescribed tablets gr ss once daily and the available tablets are gr... If a patient is prescribed tablets gr ss once daily and the available tablets are gr i, thern tablets would be given in a 14-day period. (Enter numerical answer only, do not enter units)... 1 answers ##### Suppose that$25,000 from a retirement account is invested in a large cap stock fund. After...
Suppose that $25,000 from a retirement account is invested in a large cap stock fund. After 30 yr, the value is$157,317.42. Part: 0/2 Part 1 of 2 (a) Use the model A=Pe to determine the average rate of return under continuous compounding. Round to the nearest tenth of a percent. Avoid rounding in i...
##### How do you simplify #-\frac { 9x - 9y } { 8x } + \frac { 4x - 11y } { 8x }#?
How do you simplify #-\frac { 9x - 9y } { 8x } + \frac { 4x - 11y } { 8x }#?...
##### How do cytokines affect the humoral immune response?
How do cytokines affect the humoral immune response?...
##### Concentrations of some glycolysis intermediates in the red blood cell (mM): Glucose Glucose-6-P Fructose-6-P Fructose-1,6-BP 1,3-bisphosphoglycerate...
Concentrations of some glycolysis intermediates in the red blood cell (mM): Glucose Glucose-6-P Fructose-6-P Fructose-1,6-BP 1,3-bisphosphoglycerate 0.001 3-phosphoglycerate 5.0 0.083 0.014 0.031 2- phosphoglycerate Phosphoenolpyruvate Pyruvate ATP ADP Pi 0.030 0.023 0.051 1.85 0.14 1.0 0.12 3. Isot...
##### If #P(x)=3x^3-2x^2-x+8#, what is #P(-3i)#?
If #P(x)=3x^3-2x^2-x+8#, what is #P(-3i)#?...
##### How do you divide #(4x^2+x+1)div(x-2)# using synthetic division?
How do you divide #(4x^2+x+1)div(x-2)# using synthetic division?...