Question: Define a course object with these fields: id - int semester - enum (Fall/Spring/Summer) name - string students - Student[] (From previous lab) (Or other

Define a course object with these fields:

id - int

semester - enum (Fall/Spring/Summer)

name - string

students - Student[] (From previous lab) (Or other data structure)

instructor - string

---

Properties

ID - get

Semester - get/set

Name - get/set

Instructor - get/set

---

Methods

Constructor - required parameter ID, name, optional semester, and instructor

Enroll - Takes a student, verifies they are not enrolled already and adds them to the list if they are not.

Drop - Takes a student ID and removes them from the student list.

Print - Prints the course information and student list.

---

Main. Create several students and enroll them, Print the course, drop a student and Print again.

C#

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!