Skip to content

Commit e5005a6

Browse files
authored
Create Ques13.cpp
1 parent 2b0da23 commit e5005a6

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

Ques13.cpp

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#include <iostream>
2+
using namespace std;
3+
4+
int main()
5+
{
6+
int basicPay;
7+
double houseRent, medicalAllowance, conveyanceAllowance, netPay;
8+
9+
cout << "Enter the basic pay: ";
10+
cin >> basicPay;
11+
12+
houseRent = 45 * basicPay;
13+
14+
if (basicPay > 5000)
15+
{
16+
medicalAllowance = 0.2 * basicPay;
17+
}
18+
else
19+
{
20+
medicalAllowance = 0.5 * basicPay;
21+
}
22+
23+
if (basicPay > 5000)
24+
{
25+
conveyanceAllowance = 200;
26+
}
27+
else
28+
{
29+
conveyanceAllowance = 100;
30+
}
31+
//6000 //270000 //120 //200
32+
netPay = basicPay + houseRent + medicalAllowance + conveyanceAllowance ;
33+
//4000 //180000 //200 //100
34+
35+
cout << "The net pay of an employee is: " << netPay << " rupees." << endl;
36+
37+
return 0;
38+
}

0 commit comments

Comments
 (0)