1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
EleoNora [17]
3 years ago
5

Write a program that prompts the user for their quarterly water bill for the last four quarters. The program should find and out

put 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. Use the sample run below as a model for your output.
Computers and Technology
1 answer:
Fed [463]3 years ago
4 0

Answer:

total = 0

for i in range(4):

   bill = float(input("Enter bill for quarter " + str(i+1) + ": "))

   total += bill

average = total / (4 * 3)

if average > 75:

   print("Average monthly bill is $" + str(average) + ". Too much water is being used")

if 25 <= average < 75:

   print("Average monthly bill is $" + str(average) + ". A typical amount of water is being used")

if average < 25:

   print("Average monthly bill is $" + str(average) + ". Thank you for conserving water")

Explanation:

*The code is in Python.

Create a for loop that asks the user to enter the bill for 4 quarters and calculate the total of the bills

Calculate the average monthly bill, divide the total by 12

Check the average for the given conditions. Depending on its value print the required message along with the average monthly bill

You might be interested in
How should I do it Please code for Java
andrew-mc [135]

Answer:

class Main {  

 public static void printPattern( int count, int... arr) {

     for (int i : arr) {

       for(int j=0; j<count; j++)

           System.out.printf("%d ", i);

       System.out.println();

     }

     System.out.println("------------------");

 }

 public static void main(String args[]) {

   printPattern(4, 1,2,4);

   printPattern(4, 2,3,4);

   printPattern(5, 5,4,3);

 }

}

Explanation:

Above is a compact implementation.

3 0
3 years ago
I need help with Python. The first image is the code and the 2nd is the output.
Gekata [30.6K]
The issue arises because the string you are trying to print is not a string, rather a float value. Item1, item2 and item3 are strong values (if you type some alphabets in it and not just numbers), but itemonecost, itemtwocost, and itemthreecost are explicitly type casted to float. In line 22, 23, and 24 you’re trying to print a float, by adding it with the string. One cannot add numbers to string. Rather you can type cast the itemcost to string while printing.

Add str(itemonecost) instead of itemonecost in print statement. Do this for other float variables too.

However do note that there are multiple ways to correct this issue, and I’ve just pointed one out.
4 0
3 years ago
Su now wants to modify the text box that contains her numbered list. She accesses the Format Shape pane. In what ways can Su mod
Fiesta28 [93]
I believe its E she can insert a picture in the text book
7 0
3 years ago
Read 2 more answers
Whenever you are designing a project for commercial use (making money) and need to use photographs with people in them you must
Leya [2.2K]

Answer:

Copyright

Explanation:

7 0
2 years ago
Write the definition of a function dashedline, with one parameter , an int . if the parameter is negative or zero, the function
GalinKa [24]
Static void DashedLine(int n){     if (n>1) Console.WriteLine(new String('-', n));}
5 0
3 years ago
Other questions:
  • A user can easily move to the end of a document by pressing the _____ key combination.
    10·2 answers
  • How does technology helps save the environment?​
    6·1 answer
  • Which of the following is not something that consumers need to pay attention to order to make rational choices
    6·2 answers
  • What are the ethical implications of online social media after someone has died
    8·2 answers
  • Hi I paid for brainy plus, but it says the it can't renew and try paying for it again but it won't work. Please help
    10·1 answer
  • All of the following are true about data science and big data except: a.Digital data is growing at the rate of 2.5 quintillion b
    15·1 answer
  • 3
    7·2 answers
  • In your own opinion how comes the surface grinding machine is called a highly accurate machine tool?​
    11·1 answer
  • Write a program to input elements of 4*3matrix and prints its elements properly using array ​
    7·1 answer
  • Which describes the Paradox of Automation?
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!