Esempio n. 1
0
        public static void Main()
        {
            FullTimeEmployee employeeOne = new FullTimeEmployee();

            employeeOne.firstName = "Ivan";
            employeeOne.lastName  = "Georgiev";
            employeeOne.PrintFullName();


            PartTimeEmployee employeeTwo = new PartTimeEmployee();

            employeeTwo.firstName = "Tsvetan";
            employeeTwo.lastName  = "Salkin";
            employeeTwo.PrintFullName();
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            FullTimeEmployee FTE = new FullTimeEmployee();

            FTE.firstName    = "Ram";
            FTE.lastName     = "prasad";
            FTE.yearlySalary = 50000;
            FTE.PrintFullName();
            PartTimeEmployee PTE = new PartTimeEmployee();

            PTE.firstName  = "sachin";
            PTE.lastName   = "tendulkar";
            PTE.commission = 40;
            PTE.PrintFullName();
        }
        static void Main(string[] args)
        {
            FullTimeEmployee FTE = new FullTimeEmployee();

            FTE.FirstName    = "First FTE";
            FTE.LastName     = "Last FTE";
            FTE.YearlySalary = 50000;
            FTE.PrintFullName();
            PartTimeEmployee PTE = new PartTimeEmployee();

            PTE.FirstName    = "First PTE";
            PTE.LastName     = "Last PTE";
            PTE.HourlySalary = 10;
            PTE.PrintFullName();
        }
Esempio n. 4
0
        static void Main(string[] args)
        {
            FullTimeEmployee FTE = new FullTimeEmployee();

            FTE.FirstName    = "Praveen";
            FTE.LastName     = "Prajapati";
            FTE.yearlySalary = 50000f;
            FTE.PrintFullName();

            PartTimeEmployee PTE = new PartTimeEmployee();

            PTE.FirstName  = "Chandan";
            PTE.LastName   = "Prajapati";
            PTE.HourlyRate = 407;
            PTE.PrintFullName();
        }
Esempio n. 5
0
        static void Main(string[] args)
        {
            /*
             * Inheritance
             * It is a kind of relationship between one or more classes, which allows to inherit code from one class to other
             */

            // base class is referred to as parent or super class
            // derived class is referred to as child class

            /* One of the advantage of inheritance is code re usability */

            // Single Inheritance
            // Hierarchical Inheritance
            // Multi Level Inheritance
            // Multiple Inheritance (not supported by .NET instead we have to go with interface to acheive this)

            FullTimeEmployee fte = new FullTimeEmployee();

            fte.fname        = "Anwesh";
            fte.lname        = "P";
            fte.email        = "*****@*****.**";
            fte.yearlysalary = 100000;

            Console.WriteLine(fte.fname);
            Console.WriteLine(fte.lname);
            Console.WriteLine(fte.email);
            Console.WriteLine(fte.yearlysalary);

            fte.PrintFullName();


            PartTimeEmployee pte = new PartTimeEmployee();

            pte.fname        = "Anwesh1";
            pte.lname        = "P1";
            pte.email        = "*****@*****.**";
            pte.hourlysalary = 800;

            Console.WriteLine(pte.fname);
            Console.WriteLine(pte.lname);
            Console.WriteLine(pte.email);
            Console.WriteLine(pte.hourlysalary);

            Console.ReadLine();
        }
Esempio n. 6
0
        public static void Main()
        {
            FullTimeEmployee FTE = new FullTimeEmployee();

            FTE.FirstName    = "Aniket";
            FTE.LastName     = "Dharmadhikari";
            FTE.YearlySalary = 500000;

            FTE.PrintFullName();


            PartTimeEmployee PTE = new PartTimeEmployee();

            PTE.FirstName    = "Tinki";
            PTE.LastName     = "Dharmadhikari";
            PTE.HourlySalary = 200000;
            PTE.PrintFullName();
        }
Esempio n. 7
0
        static void Main(string[] args)
        {
            FullTimeEmployee FTE = new FullTimeEmployee();

            FTE.FirstName    = "Rajiv";
            FTE.LastName     = "Meheta";
            FTE.Email        = "*****@*****.**";
            FTE.YearlySalary = 20000;
            FTE.PrintFullName();

            PartTimeEmployee PTE = new PartTimeEmployee();

            PTE.FirstName  = "Rohan";
            PTE.LastName   = "Singh";
            PTE.Email      = "*****@*****.**";
            PTE.HourlyRate = 5000;
            PTE.PrintFullName();

            Console.Read();
        }
Esempio n. 8
0
        static void Main(string[] args)
        {
            //Inheritance allows for code re-use
            //c# suuports single inheritence
            //Multi level inheritance is allowed
            //Parent class constructors are executed before
            //child class constructors

            FullTimeEmployee fte = new FullTimeEmployee();

            fte.FirstName    = "seefeesaw";
            fte.LastName     = "shongwe";
            fte.YearlySalary = 5000000;
            fte.PrintFullName();

            PartTimeEmployee pte = new PartTimeEmployee();

            pte.FirstName  = "seefeesaw";
            pte.LastName   = "shongwe";
            pte.HourlyRate = 1250;
            pte.PrintFullName();
        }