Write a program that will define the following two classes
Class Student
- Name : string
- Age: int
+ setName(string) : void
+ setAge(string): void
+ getName(): string
+ getAge(): int
+ Student (int=0, string=””)
Class Course
Private members:
1. Course Title
2. Course Teacher
3. Max size of Student number
4. count the enroll student
5. a pointer of class Student
Some hints for the public members:
1. The constructor will create a dynamic array of maxSize size and the count will equal 0 (if the maxSize is negative then it
Set the maxSize to 10
Course
- Title : string
- Teacher: string
- MaxSize: int
- count: int
- StuList: Student *
+ setTeacher(string) : void
+ setTitle(string): void
+ getTeacher(): string
+ getTitle(): string
+ insertStudent(Student): bool
+ Course (string, string, int =10)
+ Course(Course&):copy constr
+ ~Course
+ print( ): void
2. insertStudent function: if the count less than the MaxSize it will add a new student object to the StuList and increment the count then return true. Otherwise it will return false.
3. Copy Constructor: to avoid shallow copy
4. Destructor for deleting the dynamic array
5. Print( ): to print the course information (every thing)
In the main we can ask to do the following
• declare a course object C1
• set the values of C1 by using set Functions
• declare a course object C2 by using copy constructor
• Make some changes to C2
• Let the user add as much students as he want to C1 or C2
• print C1 and C2
Okay... what is your question? What have you coded so far? Make sure to use code tags when you reply with code so it will be easier for us to give help.