Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You are to write a billing program for Mission Viejo Electric Company. Obtain the following integer values from the user: - the month - the

You are to write a billing program for Mission Viejo Electric Company.

Obtain the following integer values from the user: - the month - the current meter reading - the previous meter reading

Calculate an electric bill based on the following rate & consumption table:

Kilowatt Consumption Cost ----------------------------- ---------------------------------------------- 0 - 400 KWH a flat rate of $8.50

over 400 KWH $8.50 (base rate) + 7.525 cents for each KWH over 400 (May Sept.) or

6.575 cents for each KWH over 400 (all other months)

If the user enters an invalid month, dont ask the user to enter the meter readings. Your program should tell the user that the month was invalid and the program should not continue. If the month is valid, ask for the current and previous readings. The readings cannot be negative numbers. Also the current reading has to be the same or greater than the previous reading. If not, tell the user the readings are invalid and the program should not continue. If the month and readings are ok, calculate the amount due.

if(check if the month is bad) Display invalid month

else //the month is good {

//ask for meter readings

if(the readings are bad) display bad readings

else //the readings are good {

} }

return 0;

--Make sure you output the amount due to 2 decimal places.

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

Successful Keyword Searching Initiating Research On Popular Topics Using Electronic Databases

Authors: Randall MacDonald, Susan MacDonald

1st Edition

0313306761, 978-0313306761

More Books

Students also viewed these Databases questions

Question

1. Who will you assemble on the team?

Answered: 1 week ago

Question

Did the team members feel that their work mattered

Answered: 1 week ago