| 1. |
Electricity board has decided to charge rupees based on the units consumed by a particular home. If the units consumed is less than or equal to 200, the cost for one unit is 0.5. If the unit is less than or equal to 400, the cost for one unit is 0.65 and Rs.100 extra charge. If the unit is less than or equal to 600, the cost for one unit is 0.80 and Rs.200 extra charge. If the unit is greater than 600 the cost for one unit is 1.25 and Rs.425 extra charge. You need to now calculate the electricity bill based on the units consumed (given input). |
Answer» Following are the program In C++ Language that is given below.Explanation: using namespace std; // namespace INT main() // main function { int unit; // variable decration float amt1; // variable declaration cout<<" ENTER the Input unit:"; cin>>unit; // read the value by user if (unit <=200 ) // If the units consumed is less than or equal to 200 amt1=0.5*unit; else if (unit>200 && unit<=400)// if the unit is less than or equal to 400 amt1 = (0.65*unit)+100; else if (unit>400 && unit<=600) //If the unit is less than or equal600 amt1=(0.80*unit)+200; else amt1=(1.25*unit)+425; cout<<" the cost is:"< return 0; } Enter the Input unit :100 The cost is :50 Following are the description of program Learn More : |
|