Question: C/C++ ELECTRIC BILL LAB REPORT 1) Enter your name, student ID, platform (Mac or PC) and date Name and StudentID: Class: CIS054 C/C++ Programming Platform

C/C++ ELECTRIC BILL LAB REPORT

1) Enter your name, student ID, platform (Mac or PC) and date

Name and StudentID:

Class: CIS054 C/C++ Programming

Platform (Mac or PC): Language (C or C++):

Date:

OBJECTIVES:

Use if...else if...else statements to compare numeric values Use Exception Handling in a C++ program to process unexpected or illegal inputs. Use error processing in a C program to process unexpected or illegal inputs. Refer to the lecture

PROJECT DESCRIPTION:

Create a program that does the following:

1) Read the number of kWh used by the customer

2) compute the Electric Bill with a lower rate for the baseline kWh and a higher rate for kWh over the baseline 3) display the Electric Bill If writing your program in C++, you must use TryThrowCatch Exception Handling to process unexpected or illegal inputs. If writing your program in C, you must test the return from scanf to process input errors. Refer to the FAQ links in the lecture section on Canvas

Input kWh from user, convert to double

Determine Base_kWh (up to 500)

Determine Extra_kWh (over 500)

Base_Bill = Base_kWh * 0.27

Extra_Bill = Extra_kWh * 0.55

Electric_Bill = Base_Bill + Extra_Bill

Display Electric_Bill

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!