Question: in c++ Write a program that ask the user to enter the amount of consumed water in gallons and electricity in watts. The program calculates

in c++
in c++ Write a program that ask the user to enter the

Write a program that ask the user to enter the amount of consumed water in gallons and electricity in watts. The program calculates the bill assuming that the water and electricity rates are different for different ranges of consumptions and are shown in the following table: Water Electricity Rate Rate 0.60 Consumption in Gallons 0 1000 Consumption in Watts 0 2000 0.4 1 0.8 1.25 2 Double-click to hide white space Sample input/output: Enter your water consumption in Gallons: 900 Enter your electricity consumption in watts: 1000 Details of Water cost calculation: for 900 gallons, the cost is calculated as: for first 100, cost is 100 * 0.6 = 60 for next 500, cost is 500 * 1 = 500 for the rest 300, cost is calculated as 300 1.25 - 375 Total Water Cost is 935 Details of electricity cost calculation: for 1000 watts, the cost is calculated as: 1000 * 0.4 - 400 Total bill is : 1335

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!