Ejemplo 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();
        }
Ejemplo n.º 2
0
        static void Main()
        {
            //Employee Emp = new Employee("Bhupesh",22,"Male",1001,30000);
            //Emp.DisplayEmp();

            FullTimeEmployee FTE = new FullTimeEmployee("Bhupesh", 22, "Male", 1001, 3400, 95);

            FTE.CalSalary();

            PartTimeEmployee PTE = new PartTimeEmployee("Akshay", 23, "Male", 1002, 3700, 67);

            PTE.CalSalary();
            GC.Collect();
            Console.ReadLine();
        }
Ejemplo n.º 3
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();
        }
Ejemplo n.º 4
0
        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();
        }
Ejemplo n.º 5
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();
        }
Ejemplo n.º 6
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();
        }
Ejemplo n.º 7
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();
        }
Ejemplo n.º 8
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();
        }
Ejemplo n.º 9
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();
        }
Ejemplo n.º 10
0
        static void Main(string[] args)
        {
            Console.WriteLine("Full Time Employee");
            FullTimeEmployee FTE = new FullTimeEmployee();

            FTE.FirstName    = "Amol";
            FTE.LastName     = "Bhagat";
            FTE.Email        = "*****@*****.**";
            FTE.YearlySalary = 300000;
            FTE.PrintData();
            Console.WriteLine();
            Console.WriteLine();
            Console.WriteLine("Part Time Employee");
            PartTimeEmployee PTE = new PartTimeEmployee();

            PTE.FirstName  = "Csharp";
            PTE.LastName   = "Programming";
            PTE.Email      = "*****@*****.**";
            PTE.HourlyRate = 100;
            PTE.PrintData();

            Console.ReadKey();
        }
Ejemplo n.º 11
0
        static void Main(string[] args)
        {
            //add employee 1 to full time employee
            var employee1 = new FullTimeEmployee
            {
                FirstName = "Bill",
                LastName = "Gates",
                YearsEmployed = 5
            };
            //checks to ensure is true
            Debug.Assert(employee1.ShowFullName() == "Bill Gates");
            Debug.Assert(employee1.YearsEmployed == 5);

            //add employee 2 to part time employee
            var employee2 = new PartTimeEmployee
            {
                FirstName = "Steve",
                LastName = "Jobs",
                MonthsEmployed = 2
            };
            //checks to ensure is true
            Debug.Assert(employee2.ShowFullName() == "Steve Jobs");
            Debug.Assert(employee2.MonthsEmployed == 2);
        }