The programmer intended the following pseudocode to get five sets of two numbers each, calculate the sum
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 all the numbers entered. It will not function as intended, however. Find the error.
Transcribed Image Text:
// 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 Set total = 0; = 0; For sets = 1 To MAX NUMBERS End For = For numbers = 1 To MAX SETS Display "Enter number ", numbers, " of set ", sets, "," Input number; Set sum = sum + number 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, "1 11 11 11
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 66% (6 reviews)
The error in the pseudocode is that the first For loop should iterate over MAXSETS not MAXNUMBERS Th...View the full answer
Answered By
Carly Cimino
As a tutor, my focus is to help communicate and break down difficult concepts in a way that allows students greater accessibility and comprehension to their course material. I love helping others develop a sense of personal confidence and curiosity, and I'm looking forward to the chance to interact and work with you professionally and better your academic grades.
4.30+
12+ Reviews
21+ Question Solved
Related Book For
Question Posted:
Students also viewed these Computer science questions
-
The programmer intended the following pseudocode to display the numbers 1 through 60, and then display the message Times up! It will not function as intended, however. Find the error. Declare Integer...
-
List three specific parts of the Case Guide, Objectives and Strategy Section (See below) that you had the most difficulty understanding. Describe your current understanding of these parts. Provide...
-
THIRD AVENUE SOFTWARE HEALTH-CARE APP PROJECT This case is new for the ninth edition of Information Technology Project Management . The case provides an opportunity to apply agile and Scrum...
-
Giant Corporation (a U.S. corporation) forms Small Corporation in a foreign country. Giant owns 70% of Small Corporation's stock and the remaining stock is owned by citizens of the country in which...
-
On January 1 of Year 1, Davis Company purchased 4,000 shares of the 10,000 outstanding shares of Company B for a total of $65,000. At the time of the purchase, the book value of Company Bs equity was...
-
How does the idea of a 'fat tail' extreme event affect the economics of climate change?
-
Contrast ceiling and floor limitations, and provide an example of each.
-
At December 31, 2010, Besler Corporation had a projected benefit obligation of $560,000, plan assets of $322,000, and prior service cost of $127,000 in accumulated other comprehensive income....
-
Hones 8 Linda se tornou 24.00 64.000 200. Accordion accounts of 70th cen. De recorded the compouco MC 191200 523DOC 00 8. Loma Linda, Ineses a long wed asset that original cost $24,000 for $64.000 on...
-
A chain coffee shop company is considering adding a new line of business of offering small foods and snacks. The CEO of the company hired you as a financial analyst to help the company decide if it...
-
What is a condition-controlled loop?
-
What values can you store in a Boolean variable?
-
Find the least number of times it is necessary to lift a pencil from the paper when drawing each of the graphs in Exercises 1-7 without retracing any part of the graph. b
-
You have just come into an inheritance of $25,000 from a distant relative, and you want to invest it for the long term. Provide an investment portfolio that includes five different stocks. Report the...
-
As the human resource manager, how would you evaluate the training needs of your staff? How can you ensure that the training you would provide is effective? What data might be used to make your...
-
MARYLAND CORPORATION manufactures three liquid products - Alpha, Beta and Gamma using a joint process with direct materials, direct labor and overhead totaling $560,000 per batch. In addition, the...
-
Three common organizational structures. Mention one organization for each organizational structure which is following a specific organizational structure. Also, provide support to your answer by...
-
You are a retail manager at Kitchen Nightmare, a relatively new store at the mall that sells mostly items for kitchens, like forks, oven mitts, etc.. You have been open since the fall of 2021 and...
-
Determine the frequency of oscillation for the network of Fig. 16.19 if L = 5mH, R1 = 10 (, and C = 1 (F.
-
Suppose you are comparing just two means. Among the possible statistics you could use is the difference in means, the MAD, or the max min (the difference between the largest mean and the smallest...
-
When you retrieve a value from an Entry widget, of what data type is it?
-
Use a Canvas widget to draw each of the planets of our solar system. Draw the sun first, then each planet according to distance from the sun (Mercury, Venus, Earth, Mars, Jupiter Saturn, Uranus,...
-
A(n) _______________ is a function or method that is called when a specific event occurs. a. Callback function b. Auto function c. Startup function d. Exception
-
whether the following statements is TRUE or FALSE by providing a brief explanation . b) The Value at Risk of a first project is 8 and the Value at Risk of a second project is 5. The Value at Risk of...
-
Fill out a spreadsheet using the following information to perform a NPV analysis. Revenues in each of years 1-3 = $20,000 Year 0 initial investment = $40,000 Inventory level = $10,000 in year 1,...
-
A firm has $9.5 Billion debt outstanding, with a yield to maturity of 5.3% and a coupon rate of 4.6%. They have 148 million preferred shares outstanding, currently trading at $92.29. They also have...
Study smarter with the SolutionInn App