Write a program that prompts the user for their quarterly water bill for the last four...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a program that prompts the user for their quarterly water bill for the last four quarters. The program should find and output their average monthly water bill. If the average bill exceeds $75, the output should include a message indicating that too much water is being used. If the average bill is at least $25 but no more than $75, the output should indicate that a typical amount of water is being used. Finally, if the average bill is less than $25, the output should contain a message praising the user for conserving water. To solve this exercise, use an accumulator (don't use four variables to save four quarterly water bills). Refer to Section 5.7 in your Textbook. Also, use a for-loop to input the user's quarterly water bill values and update the accumulator. Here's an example of execution for this program: Input your waterbill for quarter 1: 120 Input your waterbill for quarter 2: 99 Input your waterbill for quarter 3: 115 Input your waterbill for quarter 4: 122.47 Your average monthly bill is $38.04 You are using a typical amount of water! Write a program that prompts the user for their quarterly water bill for the last four quarters. The program should find and output their average monthly water bill. If the average bill exceeds $75, the output should include a message indicating that too much water is being used. If the average bill is at least $25 but no more than $75, the output should indicate that a typical amount of water is being used. Finally, if the average bill is less than $25, the output should contain a message praising the user for conserving water. To solve this exercise, use an accumulator (don't use four variables to save four quarterly water bills). Refer to Section 5.7 in your Textbook. Also, use a for-loop to input the user's quarterly water bill values and update the accumulator. Here's an example of execution for this program: Input your waterbill for quarter 1: 120 Input your waterbill for quarter 2: 99 Input your waterbill for quarter 3: 115 Input your waterbill for quarter 4: 122.47 Your average monthly bill is $38.04 You are using a typical amount of water!
Expert Answer:
Answer rating: 100% (QA)
Here is a Python program that implements the described functionality pyt... View the full answer
Related Book For
Introduction to Java Programming, Comprehensive Version
ISBN: 978-0133761313
10th Edition
Authors: Y. Daniel Liang
Posted Date:
Students also viewed these programming questions
-
The intensity of the sound of traffic at a busy intersection was measured at 6.0 x 10-1 W/m2. Find the decibel level. (Round your answer to the nearest whole number.) x dB 48
-
You are the Pricing Manager for Region 1 Cable System. You received the memo below from the Regional Manager of Region 1 requesting for your recommendation. Details of the memo as are below: We...
-
Discuss Planning & Preparation in relation to: Preparing work documents and performing document review Preparing an audit plan
-
The French group Club Mditerrane is an active service provider in the leisure and hospitality field with, in particular, its rich network of all-inclusive resort villages. The statements of income...
-
Ti 3+ is to be generated in 0.10 M HClO 4 solution for coulometric reduction of azobenzene. At the counter electrode, water is oxidized, and O 2 is liberated at a pressure of 0.20 bar. Both...
-
Compare and contrast different theories of state formation and summarize the role that social stratification plays in states.
-
Adams Company, a manufacturer of in-home decorative fountains, began operations on September 1 of the current year. Its cost and sales information for this year follows. Production costs Direct...
-
Milo Company manufactures beach umbrellas. The company is preparing detailed budgets for the third quarter and has assembled the following information to assist in the budget preparation: a. The...
-
We have said that todays professional sales representative is a marketing consultant and a manager of a market- his or her territory. Explain how a sales rep. can be a marketing consultant and...
-
Initially a particle of mass 1 is travelling at velocity v = 1 in one dimension, and is at position x = 2. The only force it feels is an air resistance such that F=--v. First, find the velocity of...
-
. Deniz slides a 1 kg toy for 3 m along the flor to his sister Derya. The toy is moving at 4 m/s when Deniz lets go, and at 2 m/s when Derya catches it. (a) Find the work done by friction and (b)...
-
Suppose we are putting in energy to dissociate a bubble of 1 mol of H molecules at STP (P = 105 Pa and T 300 K). We'll consider the bubble as our system and assume the pressure and temperature remain...
-
xbas y1,2 mber Owin bjec bje b. 12. In 2022, Mr. Francis, a dealer of car, disposed a brand new sports utility vehicle (SUV) which costs P800,000 for P1,200,000, under the following terms: July 1,...
-
For a single, isolated point charge carrying a charge of q= 41.2 pC, one equipotential surface consists of a sphere of radius r = 25.9 mm centered on the point charge as shown. What is the potential...
-
How are authentication and authorization alike and how are they different? What is the relationship, if any, between the two?
-
As economic conditions change, how do banks adjust their asset portfolio?
-
If the bearing pads at \(A\) and \(B\) support only vertical forces, determine the greatest magnitude of the uniform distributed loading \(w\) that can be applied to the beam. \(\sigma_{\text {allow...
-
The beam is constructed from two boards. If each nail can support a shear force of \(200 \mathrm{lb}\), determine the maximum spacing of the nails, \(s, s^{\prime}\), and \(s^{\prime \prime}\), to...
-
The simply supported beam is composed of two W12 \(\times 22\) sections built up as shown. Determine the maximum uniform loading \(w\) the beam will support if the allowable bending stress is...
Study smarter with the SolutionInn App