コード例 #1
0
ファイル: Program.cs プロジェクト: HautaN7/Demo04
        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();
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: AlbKuu/HELL2
        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();
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: SlightHeadache/kerta4
        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();
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: FiraxisGlow/O-O-T
        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();

            
        }
コード例 #5
0
ファイル: Program.cs プロジェクト: K1801/Demo04
        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();
        }
コード例 #6
0
ファイル: Program.cs プロジェクト: rikukal/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();
            
            // mahdollista olion ottaa aliluokan kutsu
            // Person person = new Teacher

        }
コード例 #7
0
        static void Main(string[] args)
        {
            Person henkilo = new Person();

            henkilo.FirstName   = "Pekka";
            henkilo.LastName    = "Pouta";
            henkilo.Address     = "Pilvilinna";
            henkilo.Age         = 69;
            henkilo.PhoneNumber = "0404040404";
            Console.WriteLine(henkilo.ToString());

            Console.WriteLine("===========================");

            Teacher ope = new Teacher();

            ope.FirstName   = "Lorppa";
            ope.LastName    = "Huuli";
            ope.Address     = "Lorppakatu";
            ope.Age         = 31;
            ope.PhoneNumber = "000000000000";
            ope.Room        = "D123";
            Console.WriteLine(ope.ToString());

            Console.WriteLine("===========================");

            Student opiskelija = new Student("hei", "hou", "m1234");

            opiskelija.Address     = "let's go";
            opiskelija.Age         = 20;
            opiskelija.PhoneNumber = "1234242";
            Console.WriteLine(opiskelija.ToString());

            henkilo.PersonMethod();
            ope.PersonMethod();
            ope.TeacherMethod();
            opiskelija.PersonMethod();
            opiskelija.StudentMethod();
        }
コード例 #8
0
ファイル: Program.cs プロジェクト: VilleBulq/Demo04
        static void Main(string[] args)
        {
            // Person person = new Person();
            // person.Firstname = "Jaska";
            // create pone student object
            Student student = new Student();

            student.Firstname   = "Niko";
            student.LastName    = "Mankinen";
            student.PhoneNumber = "696969696";
            student.Address     = "Dynamo 2";
            student.Age         = 23;
            student.StudentID   = "K1532";
            student.StudentMethod();
            Console.WriteLine(student.ToString());

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

            teacher.Address     = "Piippukatu 2";
            teacher.PhoneNumber = "04429666";
            Console.WriteLine(teacher.ToString());
            student.PersonMethod();
        }