Question: 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

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!