Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Problem 1. An electric supply company is charging the electricity consumption, a

ID: 3937172 • Letter: P

Question

Problem 1. An electric supply company is charging the electricity consumption, as follows:
A. For the first 200 units, 2.5 AED per unit
B. For the next 300 units, 4.5 AED per unit
C. Over 500 units, 5.5 AED per unit
In addition, to encourage low electricity consumption, the company offers 10% discount if the consumption is less than 180 units, and 5% surcharge is added to the cost if the consumption is greater than 600 units.
Write a C program that reads the electricity consumption in units and displays:
a) The consumer consumption cost
b) The amount of discount if any
c) The amount of surcharge if any

Explanation / Answer

#include<iostream.h>
#include<conio.h>

void main()
{ int eunits;
float ccost;


pritnf("Please enter electricity consumption");
scanf("%d",&eunits);

if(eunits<=200)
{
if(eunits<180){

ccost = 2.5*200;
ccost = ccost-((10*2.5*200)/100);
printf("The consumption cost is %f",&ccost);

}

else
{ccost = 2.5*200;
printf("The consumption cost is %f",&ccost);

}
}
else if(eunits<=500)
{
ccost = 2.5*200;
ccost = ccost+(eunits-200);
printf("The consumption cost is %f",&ccost);
}

else
{
if(eunits>600)
{
ccost = 5.5*eunits+((5*5.5*eunits)/100);
printf("The consumption cost is %f",&ccost);

}
else
{ccost = 5.5*eunits;
printf("The consumption cost is %f",&ccost);
}
}

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote