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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started