Question: The programmer intended the following pseudocode to get five sets of two numbers each, calculate the sum of each set, and calculate the sum of

The programmer intended the following pseudocode to get five sets of two numbers each, calculate the sum of each set, and calculate the sum of all the numbers entered. It will not function as intended, however. Find the error.

//This program calculates the sum of five sets of two numbers. Declare Integer number, sum, total Declare Integer sets, numbers Constant Integer MAX_SETS = 5 Constant Integer MAX_NUMBERS = 2 Set sum = 0; Set total = 0; For sets = 1 To MAX_NUMBERS For numbers = 1 To MAX_SETS Display "Enter number ", numbers, " of set ", sets, "." Input number; Set sum = sum + number End For Display "The sum of set ", sets, " is ", sum, "." Set total = total + sum Set sum = 0 End For Display "The total of all the sets is ", total, "."

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!