Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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++
image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Azure SQL Database For Modern Developers Building Applications In The Microsoft Cloud

Authors: Davide Mauri, Silvano Coriani, Anna Hoffma, Sanjay Mishra, Jovan Popovic

1st Edition

1484263693, 978-1484263693

More Books

Students also viewed these Databases questions

Question

Define Administration and Management

Answered: 1 week ago

Question

What is DDL?

Answered: 1 week ago