Prompt the user to repeatedly enter an integer. Stop when the user enters 'q' and display the
Fantastic news! We've Found the answer you've been seeking!
Question:
Prompt the user to repeatedly enter an integer. Stop when the user enters 'q' and display the sum, the minimum, the maximum and the average of all the numbers entered.
Refer to the sample interactions below.
Transcribed Image Text:
Example I: Enter an integer. You entered "q". Example II: Enter an integer. Enter an integer. Enter an integer. Enter an integer. Enter an integer. Enter "q" to stop: q Exiting the program. Enter "q" to stop: 4 Enter "q" to stop: 8 Enter "q" to stop: 19 Enter "q" to stop: 23 Enter "q" to stop: q You entered 4 integers. The sum of all the integers you entered is 54. The average is 13.50. The largest integer entered is 23. The smallest integer entered is 4. Example I: Enter an integer. You entered "q". Example II: Enter an integer. Enter an integer. Enter an integer. Enter an integer. Enter an integer. Enter "q" to stop: q Exiting the program. Enter "q" to stop: 4 Enter "q" to stop: 8 Enter "q" to stop: 19 Enter "q" to stop: 23 Enter "q" to stop: q You entered 4 integers. The sum of all the integers you entered is 54. The average is 13.50. The largest integer entered is 23. The smallest integer entered is 4.
Expert Answer:
Answer rating: 100% (QA)
Code def calculatestatisticsnumbers numcount lennumbers totalsum sumnumbers average totalsum numcount minimum minnumbers maximum maxnumbers printfYou entered numcount integer if numcount 1 else intege... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-5. Ivan's grandfather died and left a portfolio of municipal bonds. In 2012, they pay Ivan...
-
Your manager wants to implement RBAC functionality. Your shop uses a UNIX system. You do not have a system with an implementation of RBAC available to you. You have the basic capabilities of...
-
Internal auditors at Henry Flower's Flower Shop are undertaking a comprehensive review to determine if the company has complied with privacy regulations regarding customer data. In the Control...
-
What does the following code fragment print? int[] a = { 1, 2, 3 }; int[] b = { 1, 2, 3 }; System.out.println(a == b);
-
find Io (t),t>0 in the network.
-
Duck, an accrual basis corporation, sponsored a rock concert on December 29, 2016. Gross receipts were $300,000. The following expenses were incurred and paid as indicated: Because the coliseum was...
-
Supersonic airflow enters an adiabatic, constant area (inside diameter \(=1 \mathrm{ft}\) ) 30-ft-long pipe with \(\mathrm{Ma}_{1}=3.0\). The pipe friction factor is estimated to be 0.02 . What ratio...
-
Three friends are choosing a TV show to watch. Here are their preferences: a. If the three friends try using a Borda count to make their choice, what would happen? b. Monica suggests a vote by...
-
In line with your duty as police officer, make a peace advocacy. make the proper advocacy message State your goals/objectives of your advocacy. Make a plan/outline on how are you going to promote...
-
Because Natalie has had such a successful first few months, she is considering other opportunities to develop her business. One opportunity is the sale of fine European juicing machines. The owner of...
-
In Module Six, you will submit a one- to two-page document that will provide a profile of your chosen struggling company. This milestone will serve as a rough draft and must cover the three critical...
-
solve for y x 5 y + 2 0 = 0
-
1. List at least 4 steps required to create a multi-platform social media strategy.? 2. How do we gather feedback from clients regarding the effectiveness of advertisements? 3. When is the right...
-
answer these questions By using the below data 1.The loan is equal to: 2. The monthly mortgage constant is equal to: 3. The monthly payment is equal to: 4. The amount of interest paid in the...
-
For R1= 6.8k, and R2= 1k, Then: V(1) = v V. 1(2) = mA.
-
strictly evaluate the questions as you are thinking about them in general, NOT in relation to the product. i DO NOT want to hear that they need a good streaming TV service. I want to hear about their...
-
31.A square plate of side 20cm moves parallel to another plate of with a velocity of 20cm/s; both plates are immersed in water. If the viscous force is 4 x 10-N and the viscosity is 0.001 decapoise,...
-
A crop-dusting plane flies over a level field at a height of 25 ft. If the dust leaves the plane through a 30 angle and hits the ground after the plane travels 75 ft, how wide a strip is dusted? See...
-
What are the items that appear within parentheses in a calling statement called? A. Arguments B. Parameters C. Passers D. None of the above.
-
In this exercise, you modify one of the Projected Sales applications from this chapters Apply lesson. Use Windows to make a copy of the Projected Sales Solution-ForNext folder. Rename the copy...
-
The field that links a child table to a parent table is called the _____________________. A. Foreign key in the child table B. Foreign key in the parent table C. Link key in the parent table D....
-
Use the Chart screen (Chart ) to generate historical prices for the S\&P 500 spot, and call and put options on the index with different expirations and expiration. Select a period in which the...
-
Use the Chart screen (Chart ) to generate historical prices of a selected stock and its call and put options with different expirations and expiration. Select a period in which the options were...
-
Prove the following boundary conditions using an arbitrage argument. In your proof, show the initial positive cash flow when the condition is violated and prove there are no liabilities at expiration...
Study smarter with the SolutionInn App