Example #1
0
        static void Main(string[] args)
        {
            Person person = new Person();
            person.Firstname = "Kirsi";
            person.Lastname = "Kernel";
            person.Age = 31;
            person.Address = "Piippukatu 2";
            person.PhoneNumber = "645454513245";
            Console.WriteLine(person.ToString());

            Teacher teacher = new Teacher("Jussi", "Konsoli", "D456");
            teacher.Address = "Piippukatu 1";
            teacher.Age = 55;
            teacher.PhoneNumber = "4546872131";
            Console.WriteLine(teacher.ToString());

            Student student = new Student("Matti", "Kone", "K999");
            student.Age = 20;
            student.Address = "Piippukatu 3";
            student.PhoneNumber = "05048745414";
            Console.WriteLine(student.ToString());


            Console.WriteLine("Press enter to close...");
            Console.ReadLine();
        }
Example #2
0
        static void Main(string[] args)
        {
            Person person = new Person();
            person.FirstName = "Kirsi";
            person.LastName = "Kernel";
            person.Age = 35;
            person.Address = "Piippukatu 2";
            person.PhoneNumber = "020-12345678";
            Console.WriteLine(person.ToString());

            Teacher teacher = new Teacher("Jussi", "Konsoli", "D456");
            teacher.Address = "Piippukatu 1";
            teacher.Age = 40;
            teacher.PhoneNumber = "010-87654321";
            Console.WriteLine(teacher.ToString());

            Student student = new Student("Antti", "Ohjain", "N565");
            student.Address = "Aaltokatu 6";
            student.Age = 20;
            student.PhoneNumber = "014-23456789";
            Console.WriteLine(student.ToString());

            Console.WriteLine("Press enter to continue...");
            Console.ReadLine();
        }
Example #3
0
        static void Main(string[] args)
        {
            Person person = new Person();
            person.Firstname = "Make ";
            person.Lastname = "Perusjäbä ";
            person.Age = 19;
            person.Address = "Puistokatu 8 ";
            person.Phonenumber = "123 ";
            Console.WriteLine(person.ToString());

            Teacher teacher = new Teacher("Jussi ", "Konsoli ", "D456 ");
            teacher.Address = "Piippukatu 1 ";
            teacher.Age = 40;
            teacher.Phonenumber = "456 ";
            Console.WriteLine(teacher.ToString());

            Student student = new Student("Pekka ", "Mikkonen ", "H0909 ");
            student.Address = "Ojakatu 13 ";
            student.Age = 24;
            student.Phonenumber = "789 ";
            Console.WriteLine(student.ToString());

            Console.WriteLine("Press any key to continue...");
            Console.ReadLine();
        }
Example #4
0
        static void Main(string[] args)
        {
            Person person = new Person();
            person.Firstname = "Adolf";
            person.Lastname = "Hitler";
            person.Age = 90;
            person.Address = "Manala";
            person.Phonenumber = "020202";
            Console.WriteLine(person.ToString());

            Teacher teacher = new Teacher("Panu", "Alkoholi", "D404");
            teacher.Address = "Piippukatu 2";
            teacher.Age = 35;
            teacher.Phonenumber = "01010548687";
            Console.WriteLine(teacher.ToString());

            Student student = new Student();
            student.Firstname = "Jarmo";
            student.Lastname = "Pekkarinen";
            student.Age = 21;
            student.Address = "Kalmankuja 5";
            student.Phonenumber = "0503598754";
            Console.WriteLine(student.ToString());

            Console.WriteLine("Press enter key to continue...");
            Console.ReadLine();

            
        }
Example #5
0
        static void Main(string[] args)
        {
            // Create one student object
            Student student = new Student("Kirsi", "Kernel", "Piippukatu 2", "K8990");
            Console.WriteLine("Student = " + student.ToString());
            student.StudentMethod();
            student.PersonMethod();

            Teacher teacher = new Teacher("Teppo", "Terävä", "Kielokuja 2", "D566");
            Console.WriteLine("Teacher = " + teacher.ToString());
            teacher.TeacherMethod();
            teacher.PersonMethod();
        }
Example #6
0
        static void Main(string[] args)
        {
            // create one student object
            Student student = new Student("Kirsi","Kernel","Piippukatu 2","K8989");
            Console.WriteLine("Student = " + student.ToString());
            student.StudentMethod();
            student.PersonMethod();

            Teacher teacher = new Teacher("Teppo", "Terävä", "Kielokuja 2", "D566");
            Console.WriteLine("Teacher = " + teacher.ToString());
            teacher.TeacherMethod();
            teacher.PersonMethod();
            
            // mahdollista olion ottaa aliluokan kutsu
            // Person person = new Teacher

        }