I Want To Program Code In Cpp

An electricity board charges the following rates to domestic users to discourage large consumption of energy :
For the first 100 units - 60P per unit
For next 200 units - 80P per unit
Beyond 300 units - 90P per unit
All users are charged a minimum of Rs.50.If the total amount is more than Rs.300.00 then additional surcharges of 15% are added.
Write a program to read the names of users and number of units consumed and print out the charges with names.

Replies

  • simplycoder
    simplycoder
    Umesh Bhosale
    An electricity board charges the following rates to domestic users to discourage large consumption of energy :
    For the first 100 units - 60P per unit
    For next 200 units - 80P per unit
    Beyond 300 units - 90P per unit
    All users are charged a minimum of Rs.50.If the total amount is more than Rs.300.00 then additional surcharges of 15% are added.
    Write a program to read the names of users and number of units consumed and print out the charges with names.
    Can you please show us your work?
  • Vishal Sharma
    Vishal Sharma
    Umesh Bhosale
    An electricity board charges the following rates to domestic users to discourage large consumption of energy :
    For the first 100 units - 60P per unit
    For next 200 units - 80P per unit
    Beyond 300 units - 90P per unit
    All users are charged a minimum of Rs.50.If the total amount is more than Rs.300.00 then additional surcharges of 15% are added.
    Write a program to read the names of users and number of units consumed and print out the charges with names.

    oooohh 😖
    i think I'm in examination hall 😛
  • Ankita Katdare
    Ankita Katdare
    #-Link-Snipped-# Here is your free code.

    #include 
    #include 
     
    void main()
    {
    clrscr();
     
    char name[20];
    cout<<"Enter Username:";
    cin>>name;
     
    cout<<"\n Enter Number of Units Consumed:";
    float unit;
    cin>>unit;
     
    float tc;
    if(unit<=100)
        tc=unit*0.40;
    else if(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<<"YOUR BILL AMOUNT IS "<Just know that, using readymade online codes won't help you ever. Start sharing your programming codes (even if incorrect) and efforts you've taken with us here and then ask relevant questions. 

    That way you will learn in the BEST way and earn a lot of respect. 👍

You are reading an archived discussion.

Related Posts

I m a 2nd year (4th semester) Electrical Engineering student. I would like to get into the automobile industry. What should I be doing this summer? Please suggest me some...
Please any one help me........... #include #include #include #include #include #include #include class network { /* request auto detection */ int gdriver, gmode; int left, top,...
hey guys i will highly recommend to watch the minute physics channel in youtube.. its amazing with its catchy doodlin and quick n precise info
this process done for the enhancement of automobiles seem to be interesting.. can anyone explain the mechanism?
getting into the iit's is a dream come true for apirants..but the so called one of the toughest exams on earth just deal with mere intelligence..i think some people may...