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

        }
        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();
             
        }
예제 #3
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();
        }
예제 #4
0
파일: Program.cs 프로젝트: K2329/Demo4
        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();
        }
예제 #5
0
파일: Program.cs 프로젝트: karppa1/Demo1
        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();
        }
예제 #6
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();


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

        }
예제 #9
0
파일: Program.cs 프로젝트: Jnarhi/demo4
        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();
        }
예제 #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());
        }
예제 #11
0
파일: Program.cs 프로젝트: K2218/Demo04
        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();
        }
예제 #12
0
파일: Program.cs 프로젝트: k2346/demo04
        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();

        }
예제 #13
0
파일: Program.cs 프로젝트: temesky/demo04
        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();
        }
예제 #14
0
파일: Program.cs 프로젝트: K1719/Demo04
        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();
        }
예제 #15
0
파일: Program.cs 프로젝트: K1755/malli2
        static void Main(string[] args)
        {
            // create one person
            Person person = new Person();

            person.FirstName   = "Kirsi";
            person.LastName    = "Kernel";
            person.Address     = "torikatu 1";
            person.Age         = 30;
            person.PhoneNumber = "020-12345678";
            Console.WriteLine(person.ToString());

            // create one teacher
            Teacher teacher = new Teacher();

            teacher.FirstName   = "Teppo";
            teacher.LastName    = "Konsoli";
            teacher.Address     = "piippukatu 2";
            teacher.Age         = 40;
            teacher.PhoneNumber = "010-12345678";
            teacher.Room        = "D100";
            Console.WriteLine(teacher.ToString());

            // create one student
            Student student = new Student("Minna", "Husso", "J9090");

            student.Address     = "kilju 3";
            student.Age         = 20;
            student.PhoneNumber = "040-12345678";
            Console.WriteLine(student.ToString());

            // do something methods
            person.PersonMethod();   // This method belongs to Person!
            teacher.PersonMethod();  // This method belongs to Person!
            teacher.TeacherMethod(); // This method belongs to Teacher!
            student.PersonMethod();  // This method belongs to Person!
            student.StudentMethod(); // This method belongs to Student!

            Console.WriteLine("Press enter key to continue...");
            Console.ReadLine();
        }
예제 #16
0
파일: Program.cs 프로젝트: Snuffe/Demo04
        static void Main(string[] args)
        {
            // create a one Person object
            Person person = new Person();

            person.FirstName   = "Kirsi";
            person.LastName    = "Kernel";
            person.Address     = "torikatu 1";
            person.Age         = 30;
            person.PhoneNumber = "020-12345678";
            Console.WriteLine(person.ToString());

            // create a one Teacher Object
            Teacher teacher = new Teacher();

            teacher.FirstName   = "Teppo";
            teacher.LastName    = "Konsoli";
            teacher.Address     = "piippukatu 2";
            teacher.Age         = 40;
            teacher.PhoneNumber = "010-12345678";
            teacher.Room        = "D100";
            Console.WriteLine(teacher.ToString());

            // create a one Student object with parametric constuctor
            Student student = new Student("Minna", "Husso", "J9090");

            student.Address     = "kilju 3";
            student.Age         = 20;
            student.PhoneNumber = "040-12345678";
            Console.WriteLine(student.ToString());

            // do something methods
            person.PersonMethod();   // This method belongs to Person!
            teacher.PersonMethod();  // This method belongs to Person! (derived class can use it!)
            teacher.TeacherMethod(); // This method belongs to Teacher!
            student.PersonMethod();  // This method belongs to Person! (derived class can use it!)
            student.StudentMethod(); // This method belongs to Student!
        }
예제 #17
0
파일: Program.cs 프로젝트: Kivikla/Demo04
        static void Main(string[] args)
        {
            // create one student object
            Student student = new Student();

            student.Firstname   = "Teppo";
            student.Lastname    = "Terävä";
            student.Address     = "piippukatu 3";
            student.Age         = 24;
            student.PhoneNumber = "010-123456";
            student.StudentID   = "G2323";
            Console.WriteLine(student.ToString());

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

            teacher.Age         = 35;
            teacher.Address     = "Piippukatu 2";
            teacher.PhoneNumber = "010-987654";
            Console.WriteLine(teacher.ToString());

            teacher.TeacherMethod();
            student.StudentMethod();
        }
예제 #18
0
        static void Main(string[] args)
        {
            //create one teacher from Teacher class
            Teacher teacher = new Teacher();

            teacher.Firstname   = "Kirsi";
            teacher.Lastname    = "Kernel";
            teacher.Age         = 30;
            teacher.Address     = "Piippukatu2 ";
            teacher.PhoneNumber = "010-12345678";
            teacher.Room        = "D444";
            Console.WriteLine(teacher.ToString());

            Student student = new Student("Timo", "Koljonen", "K11421");

            student.Age         = 49;
            student.PhoneNumber = "044-63453243";
            Console.WriteLine(student.ToString());

            teacher.TeacherMethod();
            student.StudentMethod();
            Console.ReadLine();
        }
예제 #19
0
파일: Program.cs 프로젝트: K8504/Demo4
        static void Main(string[] args)
        {
            // create one teacher from Teacher class
            Teacher teacher = new Teacher();

            teacher.FirstName   = "Kirsi";
            teacher.LastName    = "Kernel";
            teacher.Age         = 30;
            teacher.Address     = "Piippukatu 2";
            teacher.PhoneNumber = "010-12345678";
            teacher.Room        = "D444";
            Console.WriteLine(teacher.ToString());

            Student student = new Student("Minna", "Husso", "J9090");

            student.Address     = "Kirkkokatu 10";
            student.Age         = 20;
            student.PhoneNumber = "040-1234567";
            Console.WriteLine(student.ToString());

            teacher.TeacherMethod();
            student.StudentMethod();
        }
예제 #20
0
파일: Program.cs 프로젝트: Wetski/Demo04
        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();
        }
예제 #21
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();


        }
예제 #22
0
        static void Main(string[] args)
        {
            // yliluokan olio
            //Person person = new Person();
            //person.FirstName = "Pete";
            //person.LastName = "Kauppine";
            //person.Address = "kiuru vesi";
            //person.Age = 53;
            //person.PhoneNumber = "123-4567890";
            //Console.WriteLine(person.ToString());

            // create one Student object
            Student student = new Student();

            student.FirstName   = "Joonas";
            student.LastName    = "Mankinen";
            student.Address     = "Essokatu 3";
            student.Age         = 22;
            student.PhoneNumber = "123-4567890";
            student.StudentID   = "K1554";
            Console.WriteLine(student.ToString());

            // create one Teacher method
            Teacher teacher = new Teacher("Joni", "Johtaja", "D666");

            teacher.Address     = "Hiisikuja 4";
            teacher.Age         = 22;
            teacher.PhoneNumber = "666-6666666";
            Console.WriteLine(teacher.ToString());

            // do something methods
            teacher.TeacherMethod();
            student.StudentMethod();

            student.PersonMethod();
        }
예제 #23
0
        static void Main(string[] args)
        {
            // Person ei tarvitse yleensä tehdä.

            Teacher teacher = new PersonApplication.Teacher();

            teacher.FirstName   = "Kirsi";
            teacher.LastName    = "Kernel";
            teacher.Age         = 30;
            teacher.Address     = "Piippukatu 2";
            teacher.PhoneNumber = "010-12345678";
            teacher.Room        = "D444";
            Console.WriteLine(teacher.ToString());

            Student student = new Student("Matti", "Mallikas", "H9090");

            student.Address     = "Kirkkokatu 10";
            student.Age         = 20;
            student.PhoneNumber = "040-13214414";
            Console.WriteLine(student.ToString());

            teacher.TeacherMethod();
            student.StudentMethod();
        }
예제 #24
0
        static void Main(string[] args)
        {
            // Create one teacher from Teacher class
            Teacher ope = new Teacher();

            ope.FirstName   = "Hissi";
            ope.LastName    = "Hilleri";
            ope.Address     = "Valtukunnankatu 15";
            ope.Age         = 55;
            ope.PhoneNumber = "010-5557771";
            ope.Room        = "229";
            Console.WriteLine(ope.ToString());

            // Create one Student from Student class
            Student oppilas = new Student("Kalle", "Kakkahousu", "K4KK4");

            oppilas.Address     = "Housunkuja 2";
            oppilas.Age         = 3;
            oppilas.PhoneNumber = "444-44444444";
            Console.WriteLine(oppilas.ToString());

            ope.TeacherMethod();
            oppilas.StudentMethod();
        }
예제 #25
0
        static void Main(string[] args)
        {
            // Person person = new Person();
            Teacher teacher = new Teacher();

            teacher.FirstName   = "Taneli";
            teacher.LastName    = "Sormustin";
            teacher.Room        = "D220";
            teacher.Address     = "Jyväskylä Piippukatu 2";
            teacher.PhoneNumber = "050-1234567";
            teacher.Age         = 20;
            Console.WriteLine(teacher.ToString());
            teacher.TeacherMethod();
            Console.WriteLine();

            Student student = new Student("Late", "Gee", "K1337");

            student.PhoneNumber = "010-22233344";
            student.Age         = 12;
            student.Address     = "Roskis";
            Console.WriteLine(student.ToString());
            student.StudentMethod();
            Console.WriteLine();
        }