Beispiel #1
3
        static void Main(string[] args)
        {
            Person person = new Person();
            person.Firstname = "Kirsi";
            person.Lastname = "Kernel";
            person.Age = 35;
            person.Address = "Piippukatu 2";
            person.Phonenumber = "02001215";

            Console.WriteLine(person.ToString());

            Teacher teacher = new Teacher("Jussi", "Konsoli", "D456");
            teacher.Address = "Piippukatu1";
            teacher.Age = 40;
            teacher.Phonenumber = "010-541256";

            Console.WriteLine(teacher.ToString());

            Student student = new Student("Juuso", "Jokio");
            teacher.Address = "Piippukatu 66";
            teacher.Age = 21;
            teacher.Phonenumber = "020-541256";

            Console.WriteLine(student.ToString());

            Console.WriteLine("Press enter key to continue...");
            Console.ReadLine();
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            //create one student object

            Student student = new Student();

            student.Firstname   = "matti";
            student.Lastname    = "meikalainen";
            student.Address     = "esimkatu 5";
            student.Age         = 24;
            student.Phonenumber = "12412124";
            student.StudentID   = "Q1234";

            Console.WriteLine(student.ToString());

            Teacher teacher = new Teacher("Kirsi", "Kernel", "D566");

            teacher.Age         = 35;
            teacher.Address     = "koulukuja 5";
            teacher.Phonenumber = "+35812412";
            Console.WriteLine(teacher.ToString());

            teacher.TeacherMethod();
            student.StudentMethod();
            student.PersonMethod();
        }
Beispiel #3
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 = "02001215";

            Console.WriteLine(person.ToString());

            Teacher teacher = new Teacher("Jussi", "Konsoli", "D456");

            teacher.Address     = "Piippukatu1";
            teacher.Age         = 40;
            teacher.Phonenumber = "010-541256";

            Console.WriteLine(teacher.ToString());

            Student student = new Student("Juuso", "Jokio");

            teacher.Address     = "Piippukatu 66";
            teacher.Age         = 21;
            teacher.Phonenumber = "020-541256";

            Console.WriteLine(student.ToString());

            Console.WriteLine("Press enter key to continue...");
            Console.ReadLine();
        }
Beispiel #4
0
        static void Main(string[] args)
        {
            Teacher teacher = new Teacher();

            teacher.FirstName   = "Erkki";
            teacher.LastName    = "Esimerkki";
            teacher.Age         = 69;
            teacher.Address     = "Piippukatu 69";
            teacher.PhoneNumber = "696969696969";
            teacher.Room        = "D696";
            Console.WriteLine(teacher.ToString());
            Student student = new Student("Zygmaloid", "Spencer", "K1337");

            student.Address     = "Rauskurinne 1";
            student.Age         = 12;
            student.PhoneNumber = "85854848458";
            Console.WriteLine(student.ToString());

            teacher.TeacherMethod();

            student.StudentMethod();
        }
Beispiel #5
0
        static void Main(string[] args)
        {
            //create one studen object
            Student student = new Student();

            student.Firstname   = "Seppo";
            student.Lastname    = "Virtuaalli";
            student.Address     = "katu 6";
            student.Age         = 300;
            student.PhoneNumber = "12323445";
            student.StudentID   = "a1234";
            Console.WriteLine(student.ToString());

            // create on teacher

            Teacher teacher = new Teacher("Kirsi", "Kernel", "D566");

            teacher.Age         = 55;
            teacher.Address     = "Piippukatu 2";
            teacher.PhoneNumber = "838383838";
            Console.WriteLine(teacher.ToString());
            student.PersonMethod();
        }
        static void Main(string[] args)
        {
            Person person = new Person();
            person.FirstName = "Hermanni";
            person.LastName = "Hiiri";
            person.Age = 96;
            person.Address = "Hiiriniemenkatu 6 b";
            person.PhoneNumber = "999";
            Console.WriteLine(person.ToString());

            Teacher teacher = new Teacher("Kalle","Konsoli","D456");
            teacher.Address = "Piippukatu 1";
            teacher.Age = 54;
            teacher.PhoneNumber = "010-888 9000";
            Console.WriteLine(teacher.ToString());

            Student student = new Student("Pekka", "Pikseli", "H8219");
            student.Address = "Kotipesä 1 b";
            student.Age = 22;
            student.PhoneNumber = "020202";
            Console.WriteLine(student.ToString());

            Console.ReadLine();
        }