Calculate electricity charges - C++ Program

Q. Create a class for an electricity board that charges the following rates to users

a) For first 100 units : 40p per unit
b) For next 200 units : 50p per unit
c) 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 charges of 15% are added.

Write a C++ program using class to read the names of users & number of units consumed & print out the charges with names.


using namespace std;

class Electric
        float unit;
        char name[20];
        void accept()
                cout<<"\n Enter Name   : ";
                cout<<"\n No. Of Units : ";
        void print_bill();
void Electric::print_bill()
        int bill=0;
        if(unit>=100 && unit<=300)
        else if(unit>100 && unit<=300)
        else if(unit>300)
        cout<<"\n Bill = "<<bill<<"\t"<<name;
int main()
        Electric e[10];
        int i,cnt;
        cout<<"\n Enter How Many Customers You Want? : ";
        for(i=0; i<cnt; i++)
        for(i=0; i<cnt; i++)
        return 0;


electricity bill