Question: In basic C program Write a program to calculate electric bill for your household - The price of electric bill is calculated as follows -

In basic C program

 In basic C program Write a program to calculate electric billfor your household - The price of electric bill is calculated as

Write a program to calculate electric bill for your household - The price of electric bill is calculated as follows - For the first 50 units, price is $0.5/ unit - Next 50 units, price is $0.6/ unit - Next 100 units, price is $0.75/ unit - For any unit that greater than 200, price is $1.20/ unit - Example: if household A uses 52 units this month, cost on his electric bill is (500.5)+(20.6)=25+1.2=$26.2 - The electric bill should have in 2-digit decimal places - From part A, convert code in part A into a function - Function name: electric_bill - Function input: number of usage (unit) - Function output: estimate user electric bill - Write functions maximum, minimum, and average to find maximum, minimum, and average price of electric bill - In the main function, write a program to make this program keep running and asking input from user as long as user's input (number of unit) is greater than zero - This program will print electric bill of each user (by calling above function that you created) - Once user entered zero, maximum, minimum, average cost of electric bill will be printed on the screen - Must call all 3 functions that you created

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!