I Want To Program Code In Cpp

Umesh Bhosale

Umesh Bhosale

@umesh-bhosale-dFlIAo Oct 23, 2024
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

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform

  • simplycoder

    simplycoder

    @simplycoder-NsBEdD Apr 6, 2013

    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

    @vishal-pysGmK Apr 6, 2013

    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

    @abrakadabra Apr 6, 2013

    #-Link-Snipped-# Here is your free code.

    #include <iostream.h>
    #include <conio.h>
     
    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 "<<total_cost;
     
    getch();
    }
    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. 👍