Write a program that computes (i) the sum, (ii) the average, (iii) the highest, (iv) the...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a program that computes (i) the sum, (ii) the average, (iii) the highest, (iv) the lowest and (v) the number of values of a set of values entered by the user. Set 2: As the numbers are entered, the program prints the running sum of values entered. When all the numbers are entered (when the user enters 0), the program prints the result. Test your program with the following sets of data: Set 1: Input Input 27929o 10 30 10 20 0 0 Expected results Sum: 60 Average: 20 Highest: 30 Lowest: 10 Number of values entered: 3 Expected results Sum: 30 Average: 6 Highest: 10 Lowest: 2 Number of values entered: 5 Write a program that computes (i) the sum, (ii) the average, (iii) the highest, (iv) the lowest and (v) the number of values of a set of values entered by the user. Set 2: As the numbers are entered, the program prints the running sum of values entered. When all the numbers are entered (when the user enters 0), the program prints the result. Test your program with the following sets of data: Set 1: Input Input 27929o 10 30 10 20 0 0 Expected results Sum: 60 Average: 20 Highest: 30 Lowest: 10 Number of values entered: 3 Expected results Sum: 30 Average: 6 Highest: 10 Lowest: 2 Number of values entered: 5
Expert Answer:
Answer rating: 100% (QA)
Heres a simple Python program that accomplishes the specified tasks def calculatestats values ... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Use the relationship between equilibrium constants Kc and Kp in notes, find the numeric relationship for the two constants for reaction 3 in Table 5.4. (10 points)
-
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...
-
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...
-
Randy, Inc., can issue 3-month commercial paper with a face value of $1,500,000 for $1,450,000. Transaction costs will be $1,500. The effective annualized percentage cost of the financing, based on a...
-
Explain why the solution u(k), k > 0, to the initial value problem (10.6) exists and is uniquely defined. Does this hold if we allow negative k < 0?
-
Estimating Cost of Equity Capital and Weighted Average Cost of Capital The December 31, 2018, partial financial statements taken from the annual report for AT&T Inc. (T ) follow. Consolidated...
-
Because the feed underflow in Example 14-1 was not the same as in the other stages, we had to do the feed stage calculation separately, but connected to, the calculation for the remainder of the...
-
Snols Corporation has 30,000 shares of its $1 par value common stock outstanding. Record in journal form the following transactions as they relate to the companys common stock : July17Declared a 10...
-
Find a four-year college and list it's tuition costs, dorm costs, any other costs. At any age, this is a relevant question. Find one year of costs Determine your ability to pay for it based on your...
-
Founded in 1972, the German software business SAP (Systems, Applications, and Products in Data Processing) is known as one of the world leaders in enterprise resource planning software, employing...
-
You have a portfolio that is equally invested in Stock F with a beta of 1 . 0 8 , Stock G with a beta of 1 . 4 5 , and the risk - free asset. What is the beta of your portfolio? ( keep 2 decimals....
-
Husband/Defendant: George B. Samuels; Wife/Plaintiff: Anna H. (nee Jacobs) Samuels; Date of Marriage: 7/4/2016 Children: Hannah, born 10/12/2018, and Brent, born 2/14/2020. (2) Prepare a financial...
-
If given program is executed, what will be output? Create Stack Queuequeue = new LinkedList; Create LinkedList ll; int []array = { 82, 99, 37, 20, 54 }; for (i = 0; i < array.length; i++) { int x =...
-
Consider the information below from a firm's balance sheet and calculate the Change in Net Working Capital (NWC). Current Assets 2022 2021 Cash and Equivalents $1,561 $1,800 Short-Term Investments...
-
TJMaxx (TJX) stock is currently selling for $801.93. You are thinking about buying it and you hope to sell it for $1420.12 in 4 years. What is the implied return?
-
Food X contains 6 units of Vitamin a per gram and 7 units of vitamin B per gram and costs 12 paise per gram. Food Y contains 8 units of vitamin A per gram and 12 units of vitamin B per gram and costs...
-
3. How many moles of each element are present in 2.67 mol of each compound? 1. HCI 2. HSO4 3. Al(NO3)3 4. Gaz(SO4)3
-
Would you use the adjacency matrix structure or the adjacency list structure in each of the following cases? Justify your choice. a. The graph has 10,000 vertices and 20,000 edges, and it is...
-
The velocity of a skydiver whose parachute is still closed can be modeled by assuming that the air resistance is proportional to the velocity. From Newton's second law of motion the relationship...
-
Define the variable x as x = 6. 7, then evaluate: (a) 0.01x5-1.4x3 + 80x + 16.7 (b) x3 + ex 51/x
-
The Pythagorean theorem states that a2 + b2 = c2. Write a MATLAB program in a script file that finds all the combinations of triples a, b, and c that are positive integers all smaller or equal to 50...
-
Because you own the common stock of Jacob Corporation, a paper manufacturer, you decide to analyze the firm's performance for the most recent year. The following data are taken from the firm's latest...
-
Quarterly data are presented below for Company A and Company B. One of these companies is Gibson Greetings, Inc., which manufactures and sells greeting cards. The other company is Hon Industries,...
-
Adams Plastics, Inc., manufactures various plastic and synthetic products. Financial statement data for the firm follow: Required a. Using the given data, calculate items 1 through 8 below for 2019....
Study smarter with the SolutionInn App