Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

using System;

public interface IPayable


{
void CalculatePay();
}
public class HourlyEmployee : IPayable
{
public double HoursWorked;
public double PayPerHour;
public void CalculatePay()
{

}
}
public class PermanantEmployee : IPayable
{
public double HRA;
public double DA;
public double GrossPay;
public double TAX;
public double NetPay;
public double TotalPay;
double BasicSalary = 30000;
public void CalculatePay()
{
HRA = (15 * BasicSalary) / 100;
DA = (10 * BasicSalary) / 100;
TAX = (8*(BasicSalary + HRA + DA)) / 100;
NetPay = BasicSalary + HRA + DA - TAX;
TotalPay = BasicSalary + NetPay;
Console.WriteLine("Total pay : {0}", TotalPay);
}
}
class Class1
{
static void Main(string[] args)
{
HourlyEmployee H = new HourlyEmployee();
PermanantEmployee P = new PermanantEmployee();
P.CalculatePay();
}
}

You might also like