Created
September 18, 2016 10:50
-
-
Save anhnguyen1618/493df2618378df2ac01e9f6d6753678f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace Programs | |
{ | |
//Modify this class Employee, add requested methods | |
public class Employee{ | |
private String firstName; | |
private String lastName; | |
private double salary; | |
private int idNumber; | |
public void SetName(string firName, string famiName) | |
{ | |
this.firstName = firName; | |
this.familyName = famiName; | |
} | |
public string GetName() | |
{ | |
String name = this.firstName + this.familyName; | |
return name; | |
} | |
public void SetSalary(double p) | |
{ | |
this.salary = p; | |
} | |
public void AddSalary(double p) | |
{ | |
this.salary += p; | |
} | |
public double CalcTax(double tax, double taxpercentage) | |
{ | |
return this.salary * taxpercentage; | |
} | |
public void PrintSalary() | |
{ | |
Console.WriteLine("The salary" + "of the employee " + idNumber + " is " + salary); | |
} | |
public double GetSalary() | |
{ | |
return this.salary; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment