-
Notifications
You must be signed in to change notification settings - Fork 0
/
Employee.cs
43 lines (38 loc) · 996 Bytes
/
Employee.cs
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
36
37
38
39
40
41
42
43
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
class Employee
{
double travelAllowance, performanceincentive, MS;
public void salary(double BS,double NL,double YS)
{
if(NL<=2)
{
performanceincentive = BS * 0.2;
}
else
{
performanceincentive = BS * 0.05;
}
if(YS>5)
{
travelAllowance = 10000;
}
else if(YS>2)
{
travelAllowance = 5000;
}
else
{
travelAllowance = 2500;
}
MS = BS + performanceincentive + travelAllowance;
Console.WriteLine("Congrats your monthly salary is " + MS);
Console.ReadKey();
}
}
}