Example #1
0
		static void Main(string[] args)
		{
			Person person = new Person("Joni", "Maisema");
			person.Age = 15;
			person.Address = "Kompurointikuja 609";
			person.PhoneNumber = "040-1234567";
			Console.WriteLine(person.ToString());

			Teacher teacher = new Teacher("John", "Cena", "D330");
			teacher.Age = 38;
			teacher.Address = "Unknown";
			Console.WriteLine(teacher.ToString());

			Student student = new Student();
			student.FirstName = "Kalle";
			student.LastName = "Tanttu";
			student.Age = 21;
			student.Address = "Kyminkatu 1";
			Console.WriteLine(student.ToString());

			person.PersonMethod();
			teacher.TeacherMethod();
			student.StudentMethod();

			// NotLikeThis
			//person.StudentMethod();
			//student.TeacherMethod();
		}
Example #2
0
        static void Main(string[] args)
        {
            Person person = new Person();
            person.FirstName = "Kimmo";
            person.LastName = "Oinonen";
            person.Address = "Minna Canthin katu";
            person.Age = 21;
            person.PhoneNumber = "0407298087";
            Console.WriteLine(person.ToString());

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

            Student student = new Student("Olli", "Opiskelija", "K1744");
            student.Age = 20;
            student.Address = "Koulukatu 10";
            student.PhoneNumber = "0409876543";
            Console.WriteLine(student.ToString());


            Console.WriteLine("Press enter key to continue...");
            Console.ReadLine();
        }
Example #3
0
        static void Main(string[] args)
        {
            Person person = new Person();
            person.FirstName = "Kirsi";
            person.LastName = "Kernel";
            person.Age = 35;
            person.Address = "Piippukatu ";
            person.PhoneNumber = "02012345678";
            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("Jape", "Joystick", "K2915");
            student.Address = "Alkmdsakatu 13";
            student.Age = 20;
            student.PhoneNumber = "040-52185482";
            Console.WriteLine(student.ToString());


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


        }
Example #4
0
        static void Main(string[] args)
        {
            Person person = new Person();
            person.FirstName = "Ossi";
            person.LastName = "Kuningas";
            person.Age = 24;
            person.Address = "Siltakatu 18 A 23";
            person.PhoneNumber = "0700123123";
            Console.WriteLine(person.ToString());


            Teacher teacher = new Teacher("Pekka", "Jalmari", "D619");
            teacher.Address = "Sillanalla 69";
            teacher.Age = 69;
            teacher.PhoneNumber = "0700456456";
            Console.WriteLine(teacher.ToString());

           

            Student student = new Student("Timo", "Pelle", "K2329");
            student.Address = "Pekkalantie 14";
            student.Age = 33;
            student.PhoneNumber = "0405093917";
            Console.WriteLine(student.ToString());

            Console.WriteLine("Press any key to continue...");
            Console.ReadLine();
        }
Example #5
0
        static void Main(string[] args)
        {
            Person somebody = new Person();
            somebody.FirstName = "Joe";
            somebody.LastName = "Dirt";
            somebody.Address = "Unknown";
            somebody.Age = 29;
            somebody.PhoneNumber = "040-2424234324324";
            Console.WriteLine(somebody.ToString());

            Teacher teacher = new Teacher();
            teacher.FirstName = "Jani";
            teacher.LastName = "Immonen";
            teacher.Address = "Koding";
            teacher.Age = 21;
            teacher.PhoneNumber = "Unknown";
            teacher.Room = "D330";
            Console.WriteLine(teacher.ToString());

            Student theStudent = new Student("Pekka", "Pouta", "J23432432432");
            theStudent.Address = "Kilju 3";
            theStudent.Age = 39;
            theStudent.PhoneNumber = "23432432432324";
            Console.WriteLine(theStudent.ToString());

            somebody.PersonMethod();
            teacher.PersonMethod();
            teacher.TeacherMethod();
            theStudent.PersonMethod();
            theStudent.StudentMethod();
            

            Console.ReadLine();

        }
Example #6
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 = "02012345678";
            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("Jouko", "Koodari", "K1234");
            student.Address = "Ceesharpkatu 3";
            student.Age = 24;
            student.PhoneNumber = "030132654789";
            Console.WriteLine(student.ToString());

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

        }
Example #7
0
        static void Main(string[] args)
        {
            Person somebody = new Person();
            somebody.FirstName = "John";
            somebody.LastName = "Unknown";
            somebody.Address = "Unknown";
            somebody.Age = 29;
            somebody.PhoneNumber = "123-123456";            
            Console.WriteLine(somebody.ToString());

            Teacher teacher = new Teacher();
            teacher.FirstName = "Ope";
            teacher.LastName = "Opettaja";
            teacher.Address = "Koulukatu";
            teacher.Age = 35;
            teacher.PhoneNumber = "090-098765";
            teacher.Room = "1";
            Console.WriteLine(teacher.ToString());

            Student student = new Student("Olli","Opiskelija","S1234");            
            student.Address = "Koulukatu2";
            student.Age = 30;
            student.PhoneNumber = "040-4756438";            
            Console.WriteLine(student.ToString());

            somebody.PersonMethod();
            teacher.PersonMethod();
            teacher.TeacherMethod();
            student.PersonMethod();
            student.StudentMethod();

            Console.ReadLine();
        }
        static void Main(string[] args)
        {
            Person somebody = new Person();
            somebody.FirstName = "Joe";
            somebody.LastName = "Dirt";
            somebody.Address = "Unknown";
            somebody.Age = 25;
            somebody.PhoneNumber = "0500 123456789";
            Console.WriteLine(somebody.ToString());

            Teacher teacher = new Teacher();
            teacher.FirstName = "Rape";
            teacher.LastName = "Ström";
            teacher.Address = "Unknown";
            teacher.Age = 69;
            teacher.PhoneNumber = "Unknown";
            Console.WriteLine(teacher.ToString());

            Student theStudent = new Student("Pekka", "Pouta", "666 999");
            theStudent.Address = "Kilju 3";
            theStudent.Age = 15;
            theStudent.PhoneNumber = "12345678555559";
            Console.WriteLine(theStudent.ToString());

            somebody.PersonMethod();
            teacher.PersonMethod();
            teacher.TeacherMethod();
            theStudent.PersonMethod();
            theStudent.StudentMethod();

            // no no no
            //teacher.StudentMethod();
            //theStudent.TeacherMethod();
             
        }
Example #9
0
        static void Main(string[] args)
        {
            Person person = new Person();
            person.FirstName = "Viljo";
            person.LastName = "Viljanen";
            person.Age = 75;
            person.Address = "Katukatu 47";
            person.PhoneNumber = "04012341235";
            Console.WriteLine(person.ToString());


            Teacher teacher = new Teacher("Jussi", "Konsoli", "D456");
            teacher.Address = "Tietie 23";
            teacher.Age = 45;
            teacher.PhoneNumber = "044333124652";
            Console.WriteLine(teacher.ToString());

            Student student = new Student("Matti", "Meikäläinen", "K1111");
            student.Address = "Kujakuja 33";
            student.Age = 25;
            student.PhoneNumber = "0502221335";
            Console.WriteLine(student.ToString());

            Console.WriteLine("Press enter key to continue...");
            Console.ReadLine();
        }
Example #10
0
        static void Main(string[] args)
        {
            Student student = new Student("Kirsi","Kernel","Piippukatu 2","K1698");
            Console.WriteLine("Student = " + student.ToString());

            Teacher teacher = new Teacher("Pasi", "Manninen", "Piippukatu 2", "D426");
            Console.WriteLine("Teacher = " + teacher.ToString());
        }
Example #11
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", "D256");
            Console.WriteLine("Teacher = " + teacher.ToString());
            student.PersonMethod();
        }
Example #12
0
        static void Main(string[] args)
        {
            //luo opiskelija
            Student student = new Student("Kirsi", "Kernel", "Piippukatu 2", "K8922");
            Console.WriteLine("Student = " + student.ToString());
            student.StudentMethod();
            student.PersonMethod();

            //luo opettaja
            Teacher teacher = new Teacher("Teppo", "Terävä", "kielokuja 7", "D566");
            Console.WriteLine("Teacher = " + teacher.ToString());
            teacher.TeacherMethod();
            teacher.PersonMethod();

        }
Example #13
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();

            // monimuotoisuus eli polymophismi
            // Person person = new Teacher();
        }
Example #14
0
        static void Main(string[] args)
        {
            // create on student object
            Student student = new Student("Kirsi", "Kernel", "Piippukatu 2","K2314");
            Console.WriteLine("Student = " + student.ToString());
            student.StudentMethod();
            student.PersonMethod();

            Teacher teacher = new Teacher("Teppo", "Teräsmies", "Katupiippu 2", "D556");
            Console.WriteLine("Teacher = " + teacher.ToString());
            teacher.TeacherMethod();
            teacher.PersonMethod();


        // Monimuotoisuus    Person person = new Teacher();
        }
Example #15
0
        static void Main(string[] args)
        {
            Person person = new Person("Veera", "Karhinen");
            person.Age = 19;
            person.Address = "Vehkakatu 12";
            person.PhoneNumber = "050 123 4567";
            Console.WriteLine(person.ToString());

            Teacher teacher = new Teacher("Pasi", "Manninen", "D530");
            teacher.Address = "Piippukatu 1";
            teacher.Age = 40;
            teacher.PhoneNumber = "010 765 4321";
            Console.WriteLine(teacher.ToString());

            Student student = new Student("Veeti", "Karttunen", "K1565");
            student.Age = 20;
            student.Address = "Vehkakatu 12";
            student.PhoneNumber = "050 234 5678";
            Console.WriteLine(student.ToString());

            Console.WriteLine("Press enter to continue...");
            Console.Read();
        }
Example #16
0
        static void Main(string[] args)
        {
            Person somebody = new Person();
            somebody.FirstName = "Noppa";
            somebody.LastName = "Nipples";
            somebody.Address = "twitch.tv";
            somebody.Age = 10;
            somebody.PhoneNumber = "112";

            Console.WriteLine(somebody.ToString());


            Teacher teacher = new Teacher();
            teacher.FirstName = "Dendi";
            teacher.LastName = "PugeRU";
            teacher.Address = "Dota2";
            teacher.Age = 24;
            teacher.PhoneNumber = "19-0-32";
            teacher.Room = "BottomLane";
            Console.WriteLine(teacher.ToString());

            Student theStudent = new Student("Dr", "Pepper", "9001");
            theStudent.Address = "olutta";
            theStudent.Age = 10;
            theStudent.PhoneNumber = "93865310";
            Console.WriteLine(theStudent.ToString());

            somebody.PersonMethod();
            
            teacher.TeacherMethod();
           
            theStudent.StudentMethod();

            Console.ReadLine();


        }