Question: I need to remove the bugs from the following pseudocode; // This program counts how many sales are made in each of 5 categories of

I need to remove the bugs from the following pseudocode;

// 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

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!