Question: 3. Write a C program that performs daily income accounting for electrical power company: [10 points, 25 minutes) - Takes an integer input for the

 3. Write a C program that performs daily income accounting for

3. Write a C program that performs daily income accounting for electrical power company: [10 points, 25 minutes) - Takes an integer input for the number of electrical units (ELEC_USE) used today for a customer, and computes it according to the rate below: - For the first 150 units used, the cost 1.5 Baht per unit - For next 151 - 400 units, the cost 1.85 Baht per unit - If usage exceeds 400 units, the cost 1.98 Baht per unit Outputs the daily electrical bill in baht for that customer (precision to the 2nd decimal point, or 0.01 baht) Program repeats as long as the input is zero or positive - If the input is equal to -1, the program will compute the daily total of electrical units and cost in baht and then exit. - Make sure the program is fully commented. Example output: ***Electrical bill program*** Please input number of electrical units for customer. 2 The electrical bill is 3.00 baht Please input number of electrical units for customer: 151 The electrical bill is 226.95 baht Please input number of electrical units for customer: -1 Total electrical bill income for all customers today was 153 units totaling 229.85 baht Press any key

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!