Logo 
Search:

C++ Programming Articles

Submit Article
Home » Articles » C++ Programming » BeginnersRSS Feeds

Program for electricity board charges calculation

Posted By: Easy Tutor     Category: C++ Programming     Views: 18914

An electricity board charges the following rates to domestic users to discourage large consumption of energy:

For the first 100 units - 40p per unit
For next 200 units - 50p per unit
Beyond 300 units - 60p per unit

All users are charged a minimum of Rs.500. If the total cost is more than Rs.250.00 then an additional surcharge of 15% is added.

Write a program to read the names of users and number of units consumed and print out the charges with names.

Code for Program for electricity board charges calculation in C++ Programming

/*www.DailyFreeCode.comDownload Projects, Sourcecodes, Tips and Tricks, Interview FAQs, Hotlinks and more....Logon to www.DailyFreeCode.com*//*An electricity board charges the following rates to domesticusers to discourage large consumption of energy:    For the first 100 units - 40p per unit   For next 200 units        - 50p per unit   Beyond 300 units            - 60p per unitAll users are charged a minimum of Rs.500.  If the total cost ismore than Rs.250.00 then an additional surcharge of 15% is added.    Write a program to read the names of users and number of unitsconsumed and print out the charges with names.*/

#include <iostream.h>
#include <conio.h>
void main()
{
clrscr();
cout<<"\n\n\n\tElectricity Board Charges\n";
cout<<"\n\tTo Discourage Large Consumption of energy\n\n";



char name[20];
cout<<"\n\nEnter USER name :-";
cin>>name;

cout<<"\n\nEnter Number of Units Consumed:-";
float unit;
cin>>unit;

//MANIPULATIONfloat tc;
if(unit<=100)
    tc=unit*0.40;
elseif(unit<=300)
    tc=unit*0.50;
else
    tc=unit*0.60;


float surchase=0;
if(tc>250)
    surchase=tc*0.15;

float total_cost;
total_cost = 500 + surchase + tc;

cout<<"\n\nYOUR BILL AMOUNT IS "<<total_cost;

getch();
}
  
Share: 


Didn't find what you were looking for? Find more on Program for electricity board charges calculation Or get search suggestion and latest updates.

Easy Tutor
Easy Tutor author of Program for electricity board charges calculation is from United States. Easy Tutor says

Hello Friends,

I am Free Lance Tutor, who helped student in completing their homework.

I have 4 Years of hands on experience on helping student in completing their homework. I also guide them in doing their final year projects.

I have share many programs on this website for everyone to use freely, if you need further assistance, than please contact me on easytutor.2ya [at the rate] gmail [dot] com

I have special discount scheme for providing tutor services. I am providing tutor service to students from various contries, currently most of my students are from United States, India, Australia, Pakistan, Germany, UK and Canada.

I am also here to expand my technical network to receive more opportunity in my career, make friends to help them in resolving their technical problem, learn and share my knowledge, If you like to be my friend, Please send me friend request.

Thanks,
Happy Programming :)

 
View All Articles

 

Other Interesting Articles in C++ Programming:


 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!