public static void Main(string[] args)
    {
        //Console.WriteLine("Hello World");

        //abstract class initialisation is prevented during compile time.
        //BaseEmployee be =new BaseEmployee();

        FullTimeEmployee fte = new FullTimeEmployee()
        {
            ID           = 101,
            first_name   = "Arun",
            last_name    = "May",
            anual_salary = 10000
        };

        ContractEmployee cte = new ContractEmployee()
        {
            ID          = 102,
            first_name  = "Vel",
            last_name   = "murugan",
            total_hours = 40,
            months      = 12
        };


        Console.WriteLine(cte.GetFullName());
        Console.WriteLine(cte.GetMonthlySalary());


        Console.WriteLine(fte.GetFullName());
        Console.WriteLine(fte.GetMonthlySalary());
    }
Пример #2
0
        static void Main(string[] args)
        {
            FullTimeEmployee fte = new FullTimeEmployee()
            {
                ID           = 101,
                FirstName    = "Joe",
                LastName     = "Smith",
                AnnualSalary = 60000
            };

            Console.WriteLine($"Get full name: {fte.GetFullName()},  Annual Salary: {fte.GetMonthlySalary()}");
            Console.WriteLine("------------------------------------------------");

            ContractEmployee cte = new ContractEmployee()
            {
                ID         = 102,
                FirstName  = "Sarah",
                LastName   = "Jones",
                HourlyPay  = 50,
                TotalHours = 40 * 4
            };

            Console.WriteLine($"Get full name: {cte.GetFullName()},  Annual Salary: {cte.GetMonthlySalary()}");
            Console.WriteLine("------------------------------------------------");
        }
Пример #3
0
    public static void Main()
    {
        FullTimeEmployee fte = new FullTimeEmployee()
        {
            ID           = 123,
            FirstName    = "Mark",
            LastName     = "Zuckerberg",
            AnnualSalary = 200000
        };

        Console.WriteLine(fte.GetFullName());
        Console.WriteLine(fte.GetMonthlySalary());

        ContractEmployee cte = new ContractEmployee()
        {
            ID               = 123,
            FirstName        = "Charles",
            LastName         = "Babbage",
            HourlyPay        = 200,
            TotalHoursWorked = 40
        };

        Console.WriteLine(cte.GetFullName());
        Console.WriteLine(cte.GetMonthlySalary());
    }
Пример #4
0
        public static void Main()
        {
            FullTimeEmployee fte = new FullTimeEmployee()
            {
                ID           = 101,
                FirstName    = "Rick",
                LastName     = "Wenz",
                AnnualSalary = 60000
            };

            Console.WriteLine(fte.GetFullName());
            Console.WriteLine(fte.GetMonthlySalary());

            Console.WriteLine("-------------");

            ContractEmployee cte = new ContractEmployee()
            {
                ID               = 102,
                FirstName        = "Alex",
                LastName         = "Koppel",
                HourlyPay        = 100,
                TotalHoursWorked = 40
            };

            Console.WriteLine(cte.GetFullName());
            Console.WriteLine(cte.GetMonthlySalary());
            Console.ReadLine();
        }
Пример #5
0
        static void Main(string[] args)
        {
            Console.WriteLine(" Check the Range Of Integer");
            Console.WriteLine(int.MaxValue);
            var pe = new PermanentEmployee();

            pe.FirstName    = "Dennis";
            pe.LastName     = "Ritchie";
            pe.AnnualSalary = 180000;

            var ce = new ContractEmployee();

            ce.FirstName        = "Anil";
            ce.LastName         = "Srivastava";
            ce.HourlyPay        = 2000;
            ce.TotalHoursWorked = 6;

            Console.WriteLine(pe.GetFullName());
            Console.WriteLine(pe.GetMonthlySalary());

            Console.WriteLine(ce.GetFullName());
            Console.WriteLine(ce.GetMonthlySalary());
        }