-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1st.cpp
35 lines (31 loc) · 845 Bytes
/
1st.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <iostream>
using namespace std;
int main()
{ cout<<"******************Electricity*********************\n";
string name;
cout<<"Enter name :";
cin>>name;
int unit;
float charge;
cout<<"Enter number of unit consumed :";
cin>>unit;
if(unit<=100)
{
charge=50+(0.6*unit);
cout<<"Name:"<<name<<"\tcharge :"<<charge<<"Rs"<<endl;
}
else if (unit>100 && unit<=300)
{
charge=(50+(0.8*unit));
cout<<"Name:"<<name<<"\t charge :"<<charge<<"Rs"<<endl;
}
else if (unit>300)
{
charge=(50+(0.9*unit));
cout<<"Name:"<<name<<"\t charge :"<<charge<<"Rs"<<endl;
}
if(charge>300)
charge=charge+((0.15*charge));
cout<<" Total charge :"<<charge<<"Rs"<<endl;
return 0;
}