Question: Exercise 1: Class and object definition a) Define a class Student with the following attributes: Name : char[100] Number : integer Courses: Course[10] b) Make
Exercise 1: Class and object definition
a) Define a class Student with the following attributes:
Name : char[100]
Number : integer
Courses: Course[10]
b) Make each of the above attributes private and define for each attribute a pair of public get-set-methods
c) Create a constructor-method for your Student-class for initializing objects of the Student-Class.
d) Create a class Course with following attributes:
Id: integer
Instructor: char[100]
RoomNr: integer
e) Using the above two classes create a simple application that allows the assignment of students to courses (using the Courses attribute of the class Student). Your application should internally store a sequence of Student objects either by using an array of by using a linked list.
f) Extend your application by a query function that prints for a given course-Id the name and number of all students who attend this course.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
