Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use switch statement in your implementation Write a C++ program to calculate utility cost for ACME UTILITY COMPANY. The company has 3 types of customers

Use switch statement in your implementation

Write a C++ program to calculate utility cost for ACME UTILITY COMPANY. The company has 3 types of customers (R) residential, (C) Commerical and (G) Government. Customers are billed based on the numner of kilowatts use and the type of customer they are (R, C, OR G).

Residential customers are charged 0.25 cents per kilowatt hour for the first 500kw used, and 0.35 cent per kwh for all kw used over 500.

Commercail customers are charged 0.22 cents per kilowatt hour for the first 999kw used, 0.29 cents per kwh for all kw used over 999 kw to 1999 and 0.45 cents per kwh for all kilowatts use 2000 and above. Commercial customers that use over 2000 kw are charged a special surcharge of 100.00 in addition to the regular charges.

Government customers are charged

0.34 cents for the first 1500 kwh used (<= 1500)

0.30 cents for the first 1000 kwh used (1501 - 2500)

0.25 cents for all kwh used over (>= 2501)

Input dialog:

Enter customer type:

(Q, q, R, r, C, c, or G, g) {program should accept only valid customer types)

(customer type is not case sensitve)}

{if the customer enters an invalid customer type prompt them to enter it}

{enter q or Q to quit.... your program should continue to accept the data and process bills until the letter Q, or q is entered for customer type}

letter Q or q is entered for customer type}

Enter kilowatts used:

9999.99

>>>> Utility Bill <<<<<<

Total Kilo Watts Used: 9999 Customer type: commercial

Surcharge: 999

Utility Charge is $ 999.99

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

Database Driven Web Sites

Authors: Mike Morrison, Joline Morrison

1st Edition

061901556X, 978-0619015565

More Books

Students also viewed these Databases questions

Question

Answered: 1 week ago

Answered: 1 week ago