Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started