Esempio n. 1
0
    static void Main()
    {
        Employee           accountant   = new Employee();
        Employee           programmer   = new Employee();
        CommissionEmployee salesperson1 = new CommissionEmployee();
        CommissionEmployee salesperson2 = new CommissionEmployee();

        accountant.IdNum            = 123;
        accountant.Salary           = 30_000.00;
        programmer.IdNum            = 234;
        programmer.Salary           = 12_000;
        salesperson1.IdNum          = 345;
        salesperson1.Salary         = 22_500.00;
        salesperson1.CommissionRate = 0.07;
        salesperson2.IdNum          = 456;
        salesperson2.Salary         = 1_500.00;
        salesperson2.CommissionRate = 0.04;
        WriteLine("\n" + accountant.GetGreeting());
        WriteLine("   Accountant #{0} salary: {1} per year",
                  accountant.IdNum, accountant.Salary.ToString("C"));
        WriteLine("\n" + programmer.GetGreeting());
        WriteLine("   Programmer #{0} salary: {1} per year",
                  programmer.IdNum, programmer.Salary.ToString("C"));
        WriteLine("\n" + salesperson1.GetGreeting());
        WriteLine("   Salesperson 1 #{0} salary: {1} per year",
                  salesperson1.IdNum, salesperson1.Salary.ToString("C"));
        WriteLine("...plus {0} commission on all sales",
                  salesperson1.CommissionRate.ToString("P"));
        WriteLine("\n" + salesperson2.GetGreeting());
        WriteLine("   Salesperson 2 #{0} salary: {1} per year",
                  salesperson2.IdNum, salesperson2.Salary.ToString("C"));
        WriteLine("...plus {0} commission on all sales",
                  salesperson2.CommissionRate.ToString("P"));
    }
    static void Main()
    {
        CommissionEmployee salesperson = new CommissionEmployee();

        salesperson.EmpNum = 345;
        Console.WriteLine(salesperson.GetGreeting());
    }
        static void Main()
        {
            Employee           clerk       = new Employee();
            CommissionEmployee salesperson = new CommissionEmployee();

            clerk.EmpNum               = 123;
            clerk.EmpSal               = 30000.00;
            salesperson.EmpNum         = 234;
            salesperson.EmpSal         = 20000;
            salesperson.CommissionRate = 0.07;
            Console.WriteLine("\n" + clerk.GetGreeting());
            Console.WriteLine("Clerk #{0} salary: {1} per year", clerk.EmpNum, clerk.EmpSal.ToString("C"));
            Console.WriteLine("\n" + salesperson.GetGreeting());
            Console.WriteLine("Salesperson #{0} salary: {1} per year", salesperson.EmpNum, salesperson.EmpSal.ToString("C"));
            Console.WriteLine("...plus {0} comission on all sales", salesperson.CommissionRate.ToString("P"));
            //  CommissionEmployee salesperson = new CommissionEmployee();
            salesperson.EmpNum = 345;
            Console.WriteLine(salesperson.GetGreeting());
            Console.ReadLine();
        }
Esempio n. 4
0
 public static void Main()
 {
     Employee clerk = new Employee();
       CommissionEmployee salesperson = new CommissionEmployee();
       clerk.EmpNum = 123;
       clerk.EmpSal = 30000.00;
       salesperson.EmpNum = 234;
       salesperson.EmpSal = 20000;
       salesperson.CommissionRate = 0.07;
       Console.WriteLine("\n" + clerk.GetGreeting());
       Console.WriteLine("Clerk #{0} salary: {1} per year",
      clerk.EmpNum,
      clerk.EmpSal.ToString("C"));
       Console.WriteLine("\n" + salesperson.GetGreeting());
       Console.WriteLine("Salesperson #{0} salary: {1} per year",
      salesperson.EmpNum,
      salesperson.EmpSal.ToString("C"));
       Console.WriteLine("...plus {0} commission on all sales",
      salesperson.CommissionRate.ToString("P"));
 }
 public static void Main()
 {
     CommissionEmployee salesperson = new CommissionEmployee();
       salesperson.EmpNum = 345;
       Console.WriteLine(salesperson.GetGreeting());
 }