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: 100% (2 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...
-
When researchers find a reasonably complete fossil of a dinosaur, they can determine the mass and weight of the living dinosaur with a scale model sculpted from plastic and based on the dimensions of...
-
True or False: If \(E R R>M A R R\), then MIRR \(>\) MARR.
-
Vogel Co. produces three models of heating and air conditioning thermostat components. The following table summarizes data about each model: Required: a. Criticize the preceding presentation. On what...
-
11. Sinking Fund A company borrows $5000 on which it will pay interest at the end of each year at the annual rate of 11%. In addition, a sinking fund is set up so that the $5000 can be repaid at the...
-
What is a condition-controlled loop?
-
What values can you store in a Boolean variable?
-
Now assume that the plant space could be leased out to another firm at $25,000 per year. Should this be included in the analysis? If so, how?
-
Walt Co. purchases a futures contract specifying FJ$580,500 (FJ$ stands for Fijian dollar, currency of Fiji) with the June settlement date. This futures contract is priced at $0.48/FJ$. On February...
-
South African Law. Question 1 (Marks: 10) Q.1.1 Answer the following questions by stating whether they are TRUE or FALSE and provide a reason for your answer: Q.1.1.1 Our law is the product of more...
-
Sam and David, college students, have formed a bike-sharing enterprise that they are operating during the summer between their junior and senior year of college. Sam contributed $10,000, and Dave...
-
Newbolt Corp. had pretax GAAP income of $192,000 in the current year. The January 1 balance in the Deferred Tax Asset account was $12,000. At the end of the year, the GAAP basis of deferred rent...
-
Do you agree with SEC's determination that the company should abandon front-loading of revenue and adopt a straight line revenue recognition method? Why or Why Not?
-
Northwest Carburetor Company established a fund in 2008 to accumulate money for a new plant scheduled for construction in 2011. How should this special purpose fund be reported in Northwest's balance...
-
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
-
Change the total fixed manufacturing overhead cost for the Milling Department in Data area back to $390,000, keeping all of the other data the same as in the original example. Consider a new job, Job...
-
Fickel Company has two manufacturing departments-Assembly and Testing & Packaging. The predetermined overhead rates in Assembly and Testing & Packaging are $12.00 per direct labor-hour and $8.00 per...
-
The fiscal year ends December 31 for Lake Hamilton Development. To provide funding for its Moonlight Bay project, LHD issued 9% bonds with a face amount of $610,000 on November 1, 2024. The bonds...
Study smarter with the SolutionInn App