7. Below is a simple while loop written in pseudocode. (In this pseudocode, the body of...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
7. Below is a simple while loop written in pseudocode. (In this pseudocode, the body of the loop is denoted by indentation.) Set J to 1 While (J is less than or equal to 10) Print J Add 1 to J Print J a. In the above pseudocode, what does the book call statements like J is less than or equal to 10? Hint: these statements follow while, and must unambiguously evaluate to true or false. b. Run through the algorithm by playing computer. What value is printed by the final "Print J" instruction? c. Make a version of the algorithm with the "Add" instruction line is omitted - what is the term for the kind of loop that has just been created? d. Make another version of the algorithm were you remove the last "Print instruction. Then, change the algorithm so that inside the loop it prints the even integers in the range 2 through 6 inclusively. e. In the modified version 7d above, bring back the final "Print "instruction. Now, run the algorithm and determine what will be printed by the final "Print instruction? 7. Below is a simple while loop written in pseudocode. (In this pseudocode, the body of the loop is denoted by indentation.) Set J to 1 While (J is less than or equal to 10) Print J Add 1 to J Print J a. In the above pseudocode, what does the book call statements like J is less than or equal to 10? Hint: these statements follow while, and must unambiguously evaluate to true or false. b. Run through the algorithm by playing computer. What value is printed by the final "Print J" instruction? c. Make a version of the algorithm with the "Add" instruction line is omitted - what is the term for the kind of loop that has just been created? d. Make another version of the algorithm were you remove the last "Print instruction. Then, change the algorithm so that inside the loop it prints the even integers in the range 2 through 6 inclusively. e. In the modified version 7d above, bring back the final "Print "instruction. Now, run the algorithm and determine what will be printed by the final "Print instruction?
Expert Answer:
Related Book For
Posted Date:
Students also viewed these programming questions
-
Python and most Python libraries are free to download or use, though many users use Python through a paid service. Paid services help IT organizations manage the risks associated with the use of...
-
You have been provided with the description of a programming language, J, intended for scripting applications. Its syntax is similar to a cut-down version of Java in that it consists of function...
-
Consumers commonly focus on the price when buying auto insurance. They feel less pain from buying auto insurance when they pay as little as possible However, this strategy can backfire because the...
-
Suppose you are going to receive $15,000 per year for five years. The appropriate interest rate is 8 percent. a. What is the present value of the payments if they are in the form of an ordinary...
-
An academic department has just completed voting by secret ballot for a department head. The ballot box contains four slips with votes for candidate A and three slips with votes for candidate B....
-
Although sese relationships are generally not made public unless they become stable, sese is a culturally regulated custom, the boundaries of which are clearly understood by all. There is no brute...
-
BKFin.com provides banks access to sophisticated financial information and analysis systems over the Web. The company combines these tools with benchmarking data access, including e-mail and wireless...
-
A truck carrying a film crew must be driven at the correct velocity to enable the crew to film the underside of the plane. The plane flies at 95km/h at an angle of 20 relative to the ground. How fast...
-
1:- As a result of MEXIT, Telford Engineering had lost 30% of its pre-MEXIT export sales to CETA customers, due to increased trade and tariff barriers with CETA. (See P/L account before MEXIT in the...
-
The debts which are to be repaid within a short period (year or less) are known as A. Fixed liabilities B. Contingent liabilities C. Current liabilities D. All of the above
-
A religious accommodation claim is different from a disparate treatment claim. An individual alleging denial of religious accommodation is seeking an adjustment of a neutral work rule that infringes...
-
You are the acting catering manager of BigBiz's food services division. You have entered into a catering service agreement with Slick Seminars, Inc. to supply banquet and setup services in an events...
-
Adrian, a fully qualified specialized registered nurse, is deaf. He relies upon an American Sign Language (ASL) interpreter to communicate with hearing individuals in the workplace. Adrian applied...
-
a) Due to how Donals has enough stock to control a corporation he must follow the liability of controlling shareholders. What is being violated is that since Donald has majority stock control he has...
-
Squiggy Squigman retained attorney Laverne DeFazio to represent him on a federal bank robbery charge. The indictment charged that Squigman had robbed Milwaukee Bank on Shotz Street. The prosecutor's...
-
If you have PhP5,000.00, which of the following investment alternatives would provide the greatest ending wealth for your one-year investment? 72 A. percent simple interest 100 7 B. percent...
-
Is that Yelp review real or fake? The article A Framework for Fake Review Detection in Online Consumer Electronics Retailers (Information Processing and Management 2019: 12341244) tested five...
-
Is the bottled water youre drinking really purified water? A study of various brands of bottled water conducted by the Natural Resources Defense Council found that 25% of bottled water is just tap...
-
Writing in Chance (Fall 2004), University of Konstanz (Germany) statistics professor Jan Beran demonstrated that certain aspects of music can be described by quantitative models. For example, the...
-
Suicide is the leading cause of death of Americans incarcerated in correctional facilities. To determine what factors increase the risk of suicide in urban jails, a group of researchers collected...
-
Do the assumptions for Bernoulli trials appear to hold? Explain. If the assumptions hold, identify success and the probability of interest. (a) A TV ratings company will use their electronic...
-
Use Table 1, or software, to find (a) \(B(8 ; 16,0.40)\); (b) \(b(8 ; 16,0.40)\); (c) \(B(9 ; 12,0.60)\); (d) \(b(9 ; 12,0.60)\); (e) \(\sum_{k=6}^{20} b(k ; 20,0.15)\); (f) \(\sum_{k=6}^{9} b(k ;...
-
Which conditions for the binomial distribution, if any, fail to hold in the following situations? (a) The number of persons having a cold at a family reunion attended by 30 persons. (b) Among 8...
Study smarter with the SolutionInn App