Question: Design the flowchart of this program. #include #include using namespace std; //function prototype float fee_1 (); float fee_2 (int total_unit); float fee_3 (int total_unit); float
Design the flowchart of this program.
| #include int main () { string name, address; int i = 1; int month; int total_unit = 0; float total_bill = 0.0; int code; //input of user information cout<<"\t\tELECTRIC BILL"< return 0; } float fee_1 () //user defined-function for 1st case { float bill; bill = 2.50; //minimum RM2.50 is charged for usage of 10 units or less return bill; } float fee_2 (int total_unit) //user defined-function for 2nd case { float bill; bill = total_unit * 0.25; //25 cents is charged for the first 100 units return bill; } float fee_3 (int total_unit) //user defined-function for 3rd case { float bill; bill = (100 * 0.25) + ((total_unit - 100) * 0.30); //25 cents is charged for the first 100 units, and 30 cents for the enxt 50 units return bill; } float fee_4 (int total_unit) //user defined-function for 4th case { float bill; bill = (100 * 0.25) + (50 * 0.30) + ((total_unit - 150) * 0.35); //25 cents is charged for the first 100 units, 30 cents for the enxt 50 units, and 35 cents for units over 150 units return bill; } float charge(float total_bill) //user defined-function for payment option { float after_charge; after_charge = total_bill * 1.02; //2% charge for at counter option return after_charge; } |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
