Input a list of peoples ages from the user (terminated by 0) and find the average age.
Question:
Input a list of people’s ages from the user (terminated by 0) and find the average age. Be sure to check that the user enters only positive numbers.
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 28% (7 reviews)
Code def averageno list i1 sum0 while i0 lintinputEn...View the full answer
Related Book For
Question Posted:
Students also viewed these Computer science questions
-
Input a list of positive numbers, terminated by 0, into an array Numbers[]. Then display the array and the largest and smallest number in it.
-
Create a program that allows the user to input a list of first names into one array and last names into a parallel array. Input should be terminated when the user enters a sentinel character. The...
-
An interviewer is given a list of people she can interview. If the interviewer needs to interview 5 people, and if each person (independently) agrees to be interviewed with probability 2/3, what is...
-
In the Edgeworth production box diagram, what conditions must hold for an allocation to be on the production contract curve? Why is a competitive equilibrium on the contract curve?
-
It is desirable to use well-designed controllers to maintain building temperature with solar collector space-heating systems. One solar heating system can be described by [10] dx1/dt = 3x1 + u1 + u2...
-
Visit Yahoo Finance website (https://finance.yahoo.com/). Search for a popular stock (Microsoft, Facebook, Apple, Amazon, etc.). Go to the Historical Data tab and download daily prices for the period...
-
Which inventory costing method assigns the newest, most recent, costs incurred during the period to ending inventory? a. Specific-unit cost b. First-in, first-out (FIFO) C. Last-in, first-out (LIFO)...
-
Prime Company holds 80 percent of Lane Company's stock, acquired on January 1, 20X2, for $160,000. On the date of acquisition, Lane reported retained earnings of $50,000 and $100,000 of common stock...
-
Slopes Inc. manufactures and sells snowboards. Slopes manufactures a single model, the Pipex. In the summerof 2011, Slopes' management accountant gathered the following data to preparebudgets for...
-
The result of the function call pow(2, 3, 2) function is: ) 64 b) 0 c) Error, pow() takes only 2 arguments d) 4
-
If a For loops increment is positive, then the body of the loop will not be executed if the initial value is ____________ the limiting value.
-
To ____________ data means to ensure that they are in the proper range.
-
Nakagama Limited owns 10,000 common shares of Deal Inc. purchased for selling in the near term. The carrying value of Deal Inc.'s common shares at November 30, 2014, is $46,000. The fair value of the...
-
Alex Corporation reports the following components of stockholders' equity at December 31 of the prior year. Common stock-$25 par value, 50,000 shares authorized, 33,000 shares issued and outstanding...
-
CarFind Inc. showed the following equity information at December 31, 2022. Common shares, unlimited shares authorized; 4,500,000 shares issued and outstanding Retained earnings $1,115,000 1,322,500...
-
Shown are selected financial data for Another World and Imports, Inc., at the end of the current year. Net credit sales Cost of goods sold Cash Another World Imports, Inc. $ 675,000 $560,000 504,000...
-
A manufacturer reports finished goods inventory of $820 on June 1 and $1,130 on June 30. Cost of goods manufactured for June is $5,460. What is cost of goods sold for June? Cost of Goods Sold Cost of...
-
Scott Company made a credit sale of $2,500 to a customer on January 15, 2017. The journal entry on January 15, 2017 is: Select one: a. Date Debit Credit 1/15/2017 Accounts Receivable 2500 Sales 2500...
-
How might California cities alternatively have developed a rationing by queues approach using the Internet? Why do you suppose that the Venezuelan government has begun to provide individuals with...
-
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...
-
List five non-proprietary Internet applications and the application-layer protocols that they use.
-
For a communication session between a pair of processes, which process is the client and which is the server?
-
Consider an HTTP client that wants to retrieve a Web document at a given URL. The IP address of the HTTP server is initially unknown. What transport and application-layer protocols besides IITTP are...
-
The following financial statements are for Microsoft, Inc. FY2023 and FY2022. Calculate the cash flows from operations as it would appear on the FY2023 statement of cash flows. (Hint: include all...
-
Simplify the expression.
-
A 25-year loan of 175,000 is negotiated with the borrower agreeing to repay principal and interest at 7%. A level payment of 10,000 will apply during the first twelve years and a higher level payment...
Study smarter with the SolutionInn App