-
Notifications
You must be signed in to change notification settings - Fork 0
/
Day10task2.cs
55 lines (50 loc) · 1.27 KB
/
Day10task2.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
44
45
46
47
48
49
50
51
52
53
54
55
using System;
class parent
{
public void GetData()
{
Console.WriteLine("Enter the Employee Id provided:");
int Id=Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Enter your Name:");
string Name=Console.ReadLine();
Console.WriteLine("Enter your Gender(Male/Female/Transgen:");
string Gen=Console.ReadLine();
Console.WriteLine("Enter your Years of Experience:");
int YOE=Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Your employee Id is:"+Id);
Console.WriteLine("Your name is"+Name);
Console.WriteLine("Your Gender is"+Gen);
Console.WriteLine("You have "+YOE+ "of experience");
}
public void SalCal()
{
Console.WriteLine("Enter the Salary:");
int Sal=Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Which department?(SM and PD)");
string SC=Console.ReadLine();
switch(SC)
{
case "SM":
int bonus1=Sal/5;
int res1=bonus1+Sal;
Console.WriteLine("Your Total Salary is"+res1);
break;
case "PD":
int bonus2=Sal/10;
int res2=bonus2+Sal;
Console.WriteLine("Your Total Salary is"+res2);
break;
default:
break;
}
}
}
class SalaryCal:parent
{
public static void Main()
{
SalaryCal obj=new SalaryCal();
obj.GetData();
obj.SalCal();
}
}