Correct the following code so that it reads and finds the sum of 20 numbers: count...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Correct the following code so that it reads and finds the sum of 20 numbers: count = 0 sum = while count <= 20: num= int(input('Enter next number: ')) count += 1 sum += count Note: This part of the home assignment must be manually graded by your instructor. QUESTION 16 What is the output of the following program segment? Give the value of the last number that is output for count count = 5 while (count > 0): count = count-1 print(count) Correct the following code so that it reads and finds the sum of 20 numbers: count = 0 sum = while count <= 20: num= int(input('Enter next number: ')) count += 1 sum += count Note: This part of the home assignment must be manually graded by your instructor. QUESTION 16 What is the output of the following program segment? Give the value of the last number that is output for count count = 5 while (count > 0): count = count-1 print(count)
Expert Answer:
Answer rating: 100% (QA)
15 count 0 sum 0 while count 2 insted of 2 use 20 as given in problem num intinputEnter next number ... View the full answer
Posted Date:
Students also viewed these programming questions
-
Convert the following code so that it uses nested while statements instead of for statements: int s = 0; int t = 1; for (int i = 0; i < 10; i++) { s = s + i; for (int j = i; j > 0; j) { t = t * (j ...
-
Modify the program in the previous exercise so that it reads the name of the file from the keyboard. Previous exercise Write a program that will write the Gettysburg Address to a text file. Place...
-
The blood urea nitrogen (BUN) count of 20 randomly selected patients is given here in milligrams per deciliter (mg/dl). Construct an ungrouped frequency distribution for the data. (The data for this...
-
Exam scores of 40 students in a statistics class are shown. (a) Estimate the mean and standard deviation from the sample. (b) Assuming that the data are from a normal distribution, de ne bins by...
-
Penn Corporation purchased 80 percent ownership of ENC Company on January 1, 20X2, at underlying book value. At that date, the fair value of the noncontrolling interest was equal to 20 percent of the...
-
Why did the owners pick such a big building for sustainability refitting?
-
What is Russias total for Groups A through C? Use the following balance of payments data for Russia (Russian Federation) from the IMF to answer this problem. Assumptions (million US$) 2000 2001 2002...
-
The following CVP income statements are available for Old Company and New Company. Instructions (a) Compute the break-even point in dollars and the margin of safety ratio for each company. (b)...
-
4x - y 8 5 3x+5y - 15 Use the graphing tool to graph the system. Click to enlarge graph Click the graph, choose a tool in the palette and f... 10 8 6 4 Ay 2 -10 -8 -6 -2 6 8 10 2 4 6
-
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 Customer ID 652-54310 Results of A/R Confirmations Complete the worksheet below by reviewing the accounts receivable confirmation...
-
Write the story of a communication misunderstanding that has happened to you with someone of a different culture. If you do not have a story, feel free to make one up. In your story, outline the...
-
3. Glaciers sometimes advance 20 m per year. Express this speed in m/s and in cm/day.
-
Select two products, one that you believe to have inelastic supply and another that you believe to have elastic demand. For each elastic and inelastic product you have selected explain why that...
-
Fanning Corporation estimated its overhead costs would be $ 2 2 , 6 0 0 per month except for January when it pays the $ 1 7 7 , 3 0 0 annual insurance premium on the manufacturing facility....
-
For the polynomial function f(x)=-14x +49x+x5,
-
A. Without prejudice to your answers to previous questions, and assume that Davao plans to market its product in a new territory. Davao estimates that an advertising and promotion program costing...
-
Exercise 3-20 (Static) Preparing closing entries and a post-closing trial balance LO P6 Following are accounts and year-end adjusted balances of Cruz Company as of December 31. Number 101 Account...
-
Which of the following gives the range of y = 4 - 2 -x ? (A) (- , ) (B) (- , 4) (C) [- 4, ) (D) (- , 4] (E) All reals
-
Jon Alden is puzzled. His company had a profit margin of 10% in 2002. He feels that this is an indication that the company is doing well. Anna Weis, his accountant, says that more information is...
-
(a) If Nick Flach Company had net income of \($540,000\) in 2001 and it experienced a 24.5% in- crease in net income for 2002, what is its net in- come for 2002? (b) If six cents of every dollar of...
-
Brian Tanaka Company, a retail store, has a receivables turnover ratio of 4.5 times. The industry aver- age is 12.5 times. Does Tanaka have a collection problem with its receivables?
Study smarter with the SolutionInn App