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...
-
Venture Rentals can purchase a van that costs $30,000; it has an expected useful life of three years and no salvage value . Venture uses straight-line depreciation. Expected revenue is $15,000 per...
-
The 1-year risk-free interest rate in Mexico is 10 percent. The 1-year risk-free rate in the United States is 2 percent. Assume that interest rate parity exists. The spot rate of the Mexican peso is...
-
Two light sources of identical strength are placed 10 m apart. An object is to be placed at a point P on a line parallel to the line joining the light sources and at a distance d meters from it (see...
-
You want to use the tube method to find the volume of the solid obtained by rotating about the y-axis t region in the xy-plane bounded by the curves y = 10x2 x and y = 0. A typical tube has radius z,...
-
On November 1, 2014, the following were the account balances of Rijo Equipment Repair. During November, the following summary transactions were completed. Nov. 8 Paid $1,220 for salaries due...
-
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.
-
In October of 1999, Coca-Cola announced that it was considering testing a new vending machine that was temperature sensitive. The price of the soft drinks in the machines would be higher on hot days....
-
For an object whose velocity is given by v(t) = 6 - 2t, what is its distance on the interval t = 0 to t = 4?
-
Mario and Luigi are brothers and they are equal partners in Pipes of Your Dreams Plumbing. Mario sells his fancy sports car to the business for $40,000. Marios basis in the car is $45,000. a. What is...
-
Differentiate the function. f(x) = X 1 X +10
-
1. Which type of cost is the largest for the company as a whole? 2. Which primary segment has the most sales? 3. Does the primary segment with the most sales have the highest net income? 4. Which if...
-
Ma-sipag Corporation produces a product through a continuous process in two departments. Materials in this department are added at the beginning of the process. The production and cost data were...
-
You are taking a course that has four tests. The first three tests are worth 100 points each and the fourth test is worth 200 points. To get an A in the course, you must have an average of at least...
-
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...
-
Garden Depot is a retailer that is preparing its budget for the upcoming fiscal year. Management has prepared the following summary of its budgeted cash flows: Total cash receipts Total cash...
-
(b) After analyzing the accounts, journalize the adjusting entries that were made on July 31. (List all debit entries before credit entries.Credit account titles are automatically indented when the...
-
Use the following information: a. Beginning cash balance on March 1, $81,000. b. Cash receipts from sales, $306,000. c. Budgeted cash payments for direct materials, $136,000. d. Budgeted cash...
Study smarter with the SolutionInn App