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
Libby wrote an email to her friend. She pressed Shift and the number key 2 together to enter the email address. Which symbol did
exis [7]

When Libby wrote the email to her friend, she typed the '@' symbol. When pressing SHIFT and 2 together, it pastes this aforementioned symbol. However, there isn't any specific name for the symbol. As a matter as fact, there are several names that this symbol goes by.

The most famous name this symbol is called is the "at symbol" or the "at sign". In terms of a formal name, "commercial at" would be a good one.

Here's an example with the symbol:

[email protected]

This is essentially telling the email server where to send your email. From this, they'll know it's located at brainly.com! It's pretty neat.

4 0
3 years ago
Read 2 more answers
Does a soda vending machine Give reciepts?<br><br>need for computer science hw
kupik [55]
No, they do not give receipts.<span />
6 0
3 years ago
Read 2 more answers
Assume that the classes listed in the Java Quick Reference have been imported where appropriate.
Taya2010 [7]

Answer:

Attached is a screenshot of my code for 'PasswordGenerator' and the tests necessary.

Explanation:

If you need any explanation, please ask!

3 0
3 years ago
Read 2 more answers
Write a program that prompts the user to enter the center and a point on the circle. The program should then output the circle’s
sergij07 [2.7K]

Here is the code in C++.

#include <bits/stdc++.h>

using namespace std;

// function to calculate distance between two points

double distance(int a,int b,int c,int d )

{

 // return the distance between center and point

  return sqrt(pow(c - a, 2) +

               pow(d - b, 2) * 1.0);

}

// driver function

int main()

{

// variables to store coordinates

int x1,y1,x2,y2;

cout<<"Please Enter the center(x y) of the circle: ";

//reading center

cin>>x1>>y1;

cout<<"\nPlease Enter a point(x1 y1) on the circle:";

//reading point

cin>>x2>>y2;

// calling distance() function with 4 parameters

double rad=distance(x1,y1,x2,y2);

// calculating Radius and print

cout<<"Radius of circle is: "<<rad<<endl;

// calculating Diameter and print

cout<<"Diameter of circle is: "<<2*rad<<endl;

// calculating Circumference and print

cout<<"Circumference of circle is: "<<2*3.14*rad<<endl;

// calculating Area and print

cout<<"Area of circle is: "<<3.14*rad*rad<<endl;

return 0;

}

Explanation:

First it will read coordinates of center and point on the circle.The distancebetween center and point on circle is Radius. Call distance() function withfour parameters which are coordinates of center and point. This will return the value of Radius. Diameter is 2 times of Radius.Diameter of a circle is 2*3.14*Radius. and Area of the circle is calculate as 3.14*Radius*Radius. After finding these value print them.

Output:

Please Enter the center(x y) of the circle: 0 0

Please Enter a point(x1 y1) on the circle: 3 4

Radius of circle is: 5

Diameter of circle is: 10

Circumference of circle is: 31.4

Area of circle is: 78.5

4 0
3 years ago
Robert's got a quick hand
Alina [70]
verry
good
song
love
it
6 0
2 years ago
Read 2 more answers
Other questions:
  • While driving you encounter an emergency vehicle stopped ahead. Discuss how the move over law applies to this situation and your
    13·1 answer
  • Guardrails are often used by employers to protect workers from falls. How high must the top guardrail be above the working surfa
    12·1 answer
  • Yellow and blue light are projected on a white screen. what color will the screen appear to be?
    6·2 answers
  • Interpretations of the AICPA Code of Professional Conduct are dominated by the concept of: Question 4 options: 1) independence.
    5·1 answer
  • Multiple Choice
    9·1 answer
  • Which view would you need to use to make
    14·1 answer
  • PLEASE HELP!
    14·2 answers
  • When you start a new blank document, you begin typing at the
    6·1 answer
  • PLS I NEED HELP Question 6<br> 1 pts<br> What is NOT a built-in function in python?
    5·1 answer
  • Select one Layer 2 or wireless WAN technology presented in Lesson 3. Elaborate on its characteristics, pros and cons, and common
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!