Skip to content

Instantly share code, notes, and snippets.

@anhnguyen1618
Created September 18, 2016 10:50
Show Gist options
  • Save anhnguyen1618/493df2618378df2ac01e9f6d6753678f to your computer and use it in GitHub Desktop.
Save anhnguyen1618/493df2618378df2ac01e9f6d6753678f to your computer and use it in GitHub Desktop.
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