-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEmployee.cs
More file actions
46 lines (42 loc) · 1.01 KB
/
Employee.cs
File metadata and controls
46 lines (42 loc) · 1.01 KB
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SalarySystem
{
internal class Employee
{
private int EmployeeId;
private string Name;
private double MonthlySalary;
public Employee(int employeeId, string name, double monthlySalary)
{
EmployeeId = employeeId;
Name = name;
SetSalary(monthlySalary);
}
public void SetSalary(double monthlySalary)
{
if(monthlySalary >= 0)
{
MonthlySalary = monthlySalary;
}else
{
Console.WriteLine("Invalid salary, please try again.");
}
}
public int GetEmployeeID()
{
return EmployeeId;
}
public string GetName()
{
return Name;
}
public double GetMonthlySalary()
{
return MonthlySalary;
}
}
}