Exemple #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("-------------------------------------");
            Employee employee1 = new Employee();

            employee1.Name       = "Teppo";
            employee1.Profession = "Blacksmith trainee";
            employee1.Salary     = 6000;
            Console.WriteLine(employee1.ToString());

            Console.WriteLine("-------------------------------------");
            Boss boss = new Boss();

            boss.Name       = "Seppo";
            boss.Profession = "Master Blacksmith";
            boss.Salary     = 10000;
            boss.Car        = "Nissan";
            boss.Bonus      = "New phone";
            Console.WriteLine(boss.ToString());
            Console.WriteLine("-------------------------------------");

            employee1.Salary = 3000;
            Console.WriteLine(employee1.ToString());
            Console.WriteLine("-------------------------------------");
        }
Exemple #2
0
        static void Main(string[] args)
        {
            Boss     boss     = new Boss();
            Employee employee = new Employee();

            employee.FirstName  = "Kari";
            employee.LastName   = "Lahti";
            employee.Profession = "Janitor";
            employee.Salary     = 2500;

            boss.FirstName  = "Masi";
            boss.LastName   = "Panninen";
            boss.Profession = "Head Janitor";
            boss.Salary     = 9500;
            boss.Car        = "Audi R8";
            boss.Bonus      = 3000;

            Console.WriteLine("\n" + employee.ToString() + "\n");

            Console.WriteLine("\n" + boss.ToString() + "\n");

            employee.FirstName  = "Kari";
            employee.LastName   = "Lahti";
            employee.Profession = "A bit better Janitor";
            employee.Salary     = 3500;

            Console.WriteLine("\n" + employee.ToString() + "\n");
        }
Exemple #3
0
        static void Main(string[] args)
        {
            //luo työntekijän
            Employee employee = new Employee();

            employee.Firstname  = "Kirsi";
            employee.Lastname   = "Kernel";
            employee.Profession = "Teacher";
            employee.Salary     = 1200;
            employee.EmployeeMethod();              // tulostaa employee:
            Console.WriteLine(employee.ToString()); // tulosta työntekijän tiedot



            // luo pomon
            Boss boss = new Boss();

            boss.Firstname  = "Jussi";
            boss.Lastname   = "Jurkka";
            boss.Profession = "Head of Institute";
            boss.Salary     = 9000;
            boss.Car        = "Audi";
            boss.Bonus      = 5000;
            boss.BossMethod();                  //tulostaa boss:
            Console.WriteLine(boss.ToString()); //tulostaa pomon tiedot
        }