Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Bài tập môn Object Oriented Programming 1651, Exercises of Object Oriented Programming

Bài tập môn Object Oriented Programming 1651

Typology: Exercises

2021/2022

Uploaded on 11/20/2022

huynh-van-ngoan
huynh-van-ngoan 🇺🇸

4.4

(8)

26 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
pf2

Partial preview of the text

Download Bài tập môn Object Oriented Programming 1651 and more Exercises Object Oriented Programming in PDF only on Docsity!

Inheritance Exercise Simple School Management System 1. Create a C# program that prompts the user for three names of people and stores them in an array of Person-type objects. There will be two people of the Student type and one person of the Teacher type. To do this, create a Person class that has a Name property of type string, a constructor that receives the name as a parameter and overrides the ToString () method. Then create two more classes that inherit from the Person class, they will be called Student and Teacher. The Student class has a Study method that writes by console that the student is studying. The Teacher class will have an Explain method that writes to the console that the teacher is explaining. Remember to also create two constructors on the child classes that call the parent constructor of the Person class. End the program by reading the people (the teacher and the students) and execute the Explain and Study methods. Input Juan Sara Carlos Output Explain Study Study 2. Create the Course class, with the attributes: name, a teacher in charge, and the students taking the course. Each student has a midterm and final score. A student passes the course if the total score is greater than or equal to5. The Course class has the following methods: 1651. Advanced Programming Page 1/2