Insert the missing line of code so that the following adds the integers from 1 to...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Insert the missing line of code so that the following adds the integers from 1 to 10, inclusive. x=0 top 10 = y = 1 while y < top: x = x + y #insert the missing line here and change this to a descriptive comment #1b: Explain the role of variable x in the algorithm above, and suggest a more meaningful, more descriptive name for that variable. #1c: Explain the role of variable y in the algorithm above, and suggest a more meaningful, more descriptive name for that variable. Insert the missing line of code so that the following adds the integers from 1 to 10, inclusive. x=0 top 10 = y = 1 while y < top: x = x + y #insert the missing line here and change this to a descriptive comment #1b: Explain the role of variable x in the algorithm above, and suggest a more meaningful, more descriptive name for that variable. #1c: Explain the role of variable y in the algorithm above, and suggest a more meaningful, more descriptive name for that variable.
Expert Answer:
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
can someone solve this Modern workstations typically have memory systems that incorporate two or three levels of caching. Explain why they are designed like this. [4 marks] In order to investigate...
-
Let A, B be sets. Define: (a) the Cartesian product (A B) (b) the set of relations R between A and B (c) the identity relation A on the set A [3 marks] Suppose S, T are relations between A and B, and...
-
Air flows with negligible friction through a 4-indiameter duct at a rate of = lbm/s. The temperature and pressure at the inlet are T1 = 800 R and P1 = 30 psia, and the Mach number at the exit is Ma2...
-
Leno Company makes swimsuits and sells these suits directly to retailers. Although Leno has a variety of suits, it does not make the All-Body suit used by highly skilled swimmers. The market research...
-
The US Postal Service (USPS) reports that 95% of first-class mail within the same city is delivered on time (i.e., within 2 days of the time of mailing). To gauge the USPS performance, Price...
-
To prepare the statement of cash flows, accountants for A-Mobile, Inc., vou have summarized 2008 activity in the Cash account as follows: Requirement Prepare A-Mobile's statement of cash flows for...
-
Transactions made by M. Alberti and Co., a law firm, for the month of March are shown below and on the next page. Prepare a tabular analysis which shows the effects of these transactions on the...
-
When changing jobs mid-career, an investor transferred $69,700 from a 401-K plan into an Individual Retirement Account invested entirely into the S&P 500 ETF SPY. If there are 31 years left before...
-
Beam ABC is fixed at support A and rests (at point B) upon the midpoint of beam DE (see the first part of the figure). Thus, beam ABC may be represented as a propped cantilever beam with an overhang...
-
1. Shelly' is examining an opportunity to invest $25,000 today to get a return of $40,000 in the future. If the investment grows at 12% annually, how long must shelly wait to get the future return?...
-
Alison inherited her father's MD office, but she is not a physician and has no interest in running it. A local doctor who just got her degree and wants to settle back in town is offering to buy the...
-
Identify the bias in the following surveys and explain the effect it could have on their results: a, Parents of high-school students were asked: Do you think that students should be released from...
-
An open box is constructed by cutting an z by 2 square from each corner of a 15 x 20 (cm) piece of rectangular cardboard, and folding up the sides: I 15 cm I 20 cm
-
If a bank pays 5.2% Interest with continuous compounding, what is the effective annual rate? Note: Do not round intermediate calculations. Enter your answer as a percent rounded to 2 decimal places....
-
Vicki and her friend Angela spend an hour in the sauna at thespa. Vicki is a light skinned caucasian and angela is africanamerican and has very dark skin. 1) Explain any change in skin color for both...
-
Let a > 0 and consider Ut = QUxx, u (0, t) = 0, u(, t) = 0. Suppose that the initial condition vo(r) gives solution v(r, t) and the initial condition wo(x) gives solution w(x, t). If both 0 vo 1...
-
Which of the ocean zones shown would be home to each of the following organisms: lobster, coral, mussel, porpoise, and dragonfish? For those organisms you identify as living in the pelagic...
-
Your supervisor has asked you to research the following situation concerning Owen and Lisa Cordoncillo. Owen and Lisa are brother and sister. In May 2012, Owen and Lisa exchange business pickup...
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-4. Ivan and Irene paid the following in 2012 (all by check or can otherwise be...
-
Jason and Mary Wells, friends of yours, were married on December 30, 2012. They know you are studying taxes and have come to you with a question concerning their filing status. Jason and Mary would...
-
Briefly explain the connections between values such as effort optimism, utilitarian individualism, and the American economic system. Throughout this chapter, we have identified culture as something...
-
Do you speak a language other than English as a first language? If so, do you want your children and grandchildren to speak that language? In the United States, the tools of government and education...
-
If English is your first language, did your parents or grandparents speak a different first language? How do you feel about your ability (or lack of ability) in that language? In the United States,...
Study smarter with the SolutionInn App