예제 #1
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();
        }
예제 #2
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();
        }