Question: Thank you! PLEASE READ We are working on making simple C++ programs using Putty I need help understanding how to do the problem below so








Thank you!
PLEASE READ We are working on making simple C++ programs using Putty I need help understanding how to do the problem below so that I can do others like it on my own. We have been working on using switch, break and bool this week PLEASE PAY ATTENTION TO THE TEST CASES PROVIDED the end product MUST look exactly like the test cases shown below, which is what I am having the most trouble with. Thank you in advance! Here is the problem given: Note: we cannot use flag or while loops. We are currently learning about switch, bool and if, if else, else. You are to write a billing program for Mission Viejo Electric Company. To calculate an electric bill, 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 0-400 KWH over 400 KWH Consumption Cost a flat rate of $8.50 $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) Note: we cannot use flag or while loops. We are currently learning about switch, bool and if, if else, else. If the user enters an invalid month, don't 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 /what do you do here?? if(the readings are bad) else llthe readings are good display "bad readings" lall is fine. Calculate the amount due. return 0; Enter your first name: Dave Welcome, Dave! This program will ask for the month and current and previous meter readings then calculate your electric bill. Please press "ENTER" to continue. Enter the month: 13Don't ask for meter readings 13 is an invalid month if month is bad. Enter your first name: Dave Welcome, Dave! This program will ask for the month and current and previous meter readings then calculate your electric bill. Please press "ENTER" to continue. Enter the month: 5 Enter the current meter reading: 800 Enter the previous meter reading: 1000 The readings are invalid Enter your first name: Dave Welcome, Dave! This program will ask for the month and current and previous meter readings then calculate your electric bill. Please press "ENTER" to continue Enter the month: 10 Enter the current meter reading: 10 Enter the previous meter reading: -1 The readings are invalid Enter your first name: Dave Welcome, Dave! This program will ask for the month and current and previous meter readings then calculate your electric bill. Please press "ENTER" to continue. Enter the month: 5 Enter the current meter reading: -5 Enter the previous meter reading:10 The readings are invalid Enter your first name: Dave Welcome, Dave! This program will ask for the month and current and previous meter readings then calculate your electric bill. Please press "ENTER" to continue. Enter the month: 5 Enter the current meter reading: 1200 Enter the previous meter reading: 500 You consumed 700 KWH and your amount due is $31.07 If you get $31.08, that is ok. Enter your first name: Dave Welcome, Dave! This program will ask for the month and current and previous meter readings then calculate your electric bill. Please press "ENTER" to continue. Enter the month: 5 Enter the current meter reading: 1200 Enter the previous meter reading: 1000 You consumed 200 KWH and your amount due is $8.50 Enter your first name: Dave Welcome, Dave! This program will ask for the month and current and previous meter readings then calculate your electric bill. Please press "ENTER" to continue. Enter the month: 4 Enter the current meter reading: 1200 Enter the previous meter reading: 500 You consumed 700 KWH and your amount due is $28.23 Enter your first name: Dave Welcome, Dave! This program will ask for the month and current and previous meter readings then calculate your electric bill. Please press "ENTER" to continue. Enter your first name: Dave Welcome, Dave! This program will ask for the month and current and previous meter readings then calculate your electric bill. Please press "ENTER" to continue. Enter the month: 10 Enter the current meter reading: 1200 Enter the previous meter reading: 500 You consumed 700 KWH and your amount due is $28.23
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
