Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            Console.WriteLine
            (
                "----------------------------\n" +
                "The Employee Class Hierarchy\n" +
                "----------------------------\n"
            );

            SalesPerson mark = new SalesPerson("Mark", 101, 32, 30000, "123-456-7890", 70);

            Console.WriteLine
            (
                $"Name:\t{mark.Name}\n" +
                $"ID:\t{mark.ID}\n" +
                $"Age:\t{mark.Age}\n" +
                $"Pay:\t{mark.Pay}\n" +
                $"SSN:\t{mark.empSSN}\n" +
                $"Sales:\t{mark.SalesNumber}"
            );

            Console.WriteLine("Two ways to call BenefitPackage's ComputePayDeduction method: ");
            Console.WriteLine($"Method: {mark.GetBenefitsCost()}");
            Console.WriteLine($"Property: {mark.BenefitsCost}");

            mark.GiveBonus(100);
            Console.WriteLine($"Pay after bonus: {mark.Pay}");

            Console.WriteLine
            (
                "\n--------------" +
                "\nEnd of Program" +
                "\n--------------"
            );
            Console.WriteLine("Press any key to continue");
            Console.ReadKey();
        }
Ejemplo n.º 2
0
            static void Main(string[] args)
            {
                Employee emp = new Employee("nit", 1, 2000, 29, 11);

                emp.DisplayStatus();
                emp.GiveBonous(1000.12);
                emp.DisplayStatus();
                //Employee.BenefitPacakage mypacakage ;  nested class .
                // mypacakage = new Employee.BenefitPacakage();
                // mypacakage.ComputePayDeduction();
                //emp.mypacakage.ComputePayDeduction();
                //Employee.BenefitPacakage.BenefitPacakgeLevel.myBenefitlevel = Employee.BenefitPacakage.BenefitPacakgeLevel.gold;

                ///
                emp.Name = "NitM";
                emp.Id   = 0;
                emp.Pay  = 4000;
                emp.DisplayStatus();

                ///

                Manager manager = new Manager("eddy", 1, 3000, 42, 14, 18);

                manager.DisplayStatus();
                manager.DispalyDentalHealthAllowance();
                Console.WriteLine("the stock options is {0}", manager.stockoptions);

                ///

                Manager manager1 = new Manager("felix", 2, 3500, 36, 17, 45);

                manager1.DisplayStatus();
                manager1.DispalyDentalHealthAllowance();
                Console.WriteLine("the stock option for felix is {0}", manager1.stockoptions);

                ///

                SalesPerson salesman = new SalesPerson("jenson", 3, 2200, 40, 09, 100);

                salesman.DisplayStatus();
                Console.WriteLine("the number of stock options is ", salesman.salesnumber);

                ///
                PTsalesperson timesalesperson = new PTsalesperson("selven", 4, 1000, 25, 08, 15, "4 hours");

                timesalesperson.DisplayStatus();
                Console.WriteLine("the work time for part time sales person is", timesalesperson.workingtime);



                /*
                 * Manager HeadManager = new Manager();
                 * HeadManager.Name = "Athul";
                 * HeadManager.Id = 1;
                 * HeadManager.Pay = 3000;
                 * HeadManager.Age = 41;
                 * HeadManager.stockoptions = 12;
                 *
                 *
                 * HeadManager.DisplayStatus();
                 * Console.WriteLine("The number of stockoptions {0}", HeadManager.stockoptions);
                 */



                ///



                Console.ReadLine();
            }