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
output HEAD1
output HEAD2
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
letterGrade = GRADES[NUM_TESTS]
output name, letterGrade
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 HEAD1 = "Sales"
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
output HEAD1
output HEAD2
category = 0
while category <= SIZE
output category + 1, sales[category]
category = category + 1
endwhile
stop
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
Turning this Pseudocode into the described C++ Program? (will include Pseudocode AND Description of the Program below!) Pseudoode: start Declarations num deptNum num salary num hrsWorked num SIZE = 7 num totalGross[SIZE] = 0 string DEPTS[SIZE] = “Personnel”, “Marketing”, “Manufacturing”, “Computer Services”, “Sales”, “Accounting”, “Shipping” getReady() while not eof detailLoop() endwhile finishUp() stop getReady() output “Enter the department number, hourly salary, and number of hours worked” input deptNum, salary, hrsWorked return detailLoop() if deptNum >= 1 AND deptNum...
// This application reads sales data for a real estate broker. // The user enters a record for each of 10 salespeople // containing the salesperson's name, // the number of properties sold by that person during the month, // and the total value of those properties. // The data records are sorted by value so the data for // the top three salespeople can be displayed. // Modify the program to // (1) enter data for any number of...
Program 7 Arrays: building and sorting (100 points) Due: Friday, October 30 by 11:59 PM Overview For this assignment, write a program that will calculate the quiz average for a student in the CSCI 240 course. The student's quiz information will be needed for later processing, so it will be stored in an array. For the assignment, declare one array that will hold a maximum of 12 integer elements (ie. the quiz scores). It is recommended that this program be...
Use program control statements in the following exercises: Question 1 . Write pseudocode for the following: • Input a time in seconds. • Convert this time to hours, minutes, and seconds and print the result as shown in the following example: 2 300 seconds converts to 0 hours, 38 minutes, 20 seconds. Question 2. The voting for a company chairperson is recorded by entering the numbers 1 to 5 at the keyboard, depending on which of the five candidates secured...
Need code written for a java eclipse program that will follow the skeleton code. Exams and assignments are weighted You will design a Java grade calculator for this assignment. A user should be able to calculate her/his letter grade in COMS/MIS 207 by inputting their scores obtained on worksheets, assignments and exams into the program. A skeleton code named GradeCompute.java containing the main method and stubs for a few other methods, is provided to you. You must not modify/make changes...