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(); }
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(); }
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(); }
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(); }
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(); }
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 = "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(); }
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(); }
static void Main(string[] args) { // create a register PersonRegister myFriends = new PersonRegister(); // create a few persons Person person1 = new Person(); person1.Firstname = "Matti"; person1.Lastname = "Mainio"; person1.SocialSecurityNumber = "121212-1212"; Person person2 = new Person { Firstname = "Kirsi", Lastname = "Kernel", SocialSecurityNumber = "101010-1010" }; // add persons to collection myFriends.AddPerson(person1); myFriends.AddPerson(person2); // get one person from register Person person3 = myFriends.GetPerson(0); // index = 0 if (person3 != null) { Console.WriteLine(person3.ToString()); } else { Console.WriteLine("Can't find person in that index"); } string sotu = "121212-1212asd"; Console.WriteLine("Finding person with sotu: " + sotu); Person person4 = myFriends.FindPerson(sotu); if (person4 != null) { Console.WriteLine(person4.ToString()); } else { Console.WriteLine("Can't find person with that sotu"); } Console.WriteLine(); myFriends.PrintData(); Console.ReadLine(); }
static void Main(string[] args) { // create a register PersonRegister myFriends = new PersonRegister(); //create a new person Person person1 = new Person(); person1.Firstname = "Matti"; person1.Lastname = "Mainio"; person1.SocialSecurityNum = "231- 225"; Person person2 = new Person { Firstname = "Kirsi", Lastname = "Kernel", SocialSecurityNum = "123 - 4856" }; // add person to the collection myFriends.AddPerson(person1); myFriends.AddPerson(person2); //get one person from register Person person3 = myFriends.GetPerson(0); //index = 0 if (person3 != null) { Console.WriteLine(person3.ToString()); } else { Console.WriteLine("Can't find person in that index"); } string sotu = "123 - 4856"; Console.WriteLine("Finding person with sotu.."); Person person4 = myFriends.FindPerson(sotu); if (person4 != null) { Console.WriteLine(person4.ToString()); } else { Console.WriteLine("Can't fina person with that sotu.."); } myFriends.PrintData(); }
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(); }
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(); }
/// <summary> /// Adds new person to collection /// </summary> /// <param name="person">person to added</param> public void AddPerson(Person person) { persons.Add(person); }
static void Main(string[] args) { Person s = new Person("John", "Doe"); s.PersonMethod(); Console.WriteLine(s.ToString()); }