static void Main(string[] args) { Person person = new Person(); person.Firstname = "Kirsi"; person.Lastname = "Kernel"; person.Age = 35; person.Address = "Piippukatu 2"; person.Phonenumber = "02001215"; Console.WriteLine(person.ToString()); Teacher teacher = new Teacher("Jussi", "Konsoli", "D456"); teacher.Address = "Piippukatu1"; teacher.Age = 40; teacher.Phonenumber = "010-541256"; Console.WriteLine(teacher.ToString()); Student student = new Student("Juuso", "Jokio"); teacher.Address = "Piippukatu 66"; teacher.Age = 21; teacher.Phonenumber = "020-541256"; Console.WriteLine(student.ToString()); Console.WriteLine("Press enter key to continue..."); Console.ReadLine(); }
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(); }
static void Main(string[] args) { //create one studen object Student student = new Student(); student.Firstname = "Seppo"; student.Lastname = "Virtuaalli"; student.Address = "katu 6"; student.Age = 300; student.PhoneNumber = "12323445"; student.StudentID = "a1234"; Console.WriteLine(student.ToString()); // create on teacher Teacher teacher = new Teacher("Kirsi", "Kernel", "D566"); teacher.Age = 55; teacher.Address = "Piippukatu 2"; teacher.PhoneNumber = "838383838"; Console.WriteLine(teacher.ToString()); student.PersonMethod(); }
static void Main(string[] args) { Person person = new Person(); person.FirstName = "Hermanni"; person.LastName = "Hiiri"; person.Age = 96; person.Address = "Hiiriniemenkatu 6 b"; person.PhoneNumber = "999"; Console.WriteLine(person.ToString()); Teacher teacher = new Teacher("Kalle","Konsoli","D456"); teacher.Address = "Piippukatu 1"; teacher.Age = 54; teacher.PhoneNumber = "010-888 9000"; Console.WriteLine(teacher.ToString()); Student student = new Student("Pekka", "Pikseli", "H8219"); student.Address = "Kotipesä 1 b"; student.Age = 22; student.PhoneNumber = "020202"; Console.WriteLine(student.ToString()); Console.ReadLine(); }