Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Q7. Write a class StudentRegister which contains a list of students, where students are objects of the classes you wrote in questions 3, 4 and

image text in transcribed

Q7. Write a class StudentRegister which contains a list of students, where students are objects of the classes you wrote in questions 3, 4 and 5. The class should have an array of pointer to Student to store student objects. It should be possible to store up to 1000 students in the register. The class should have a data member that records the number of students currently in the register. The class should have the following data members A constructor that takes no parameters and initializes the number of students to 0 . A method add(const Student & student) that allows a student object to be added to the register (to the array of pointers). This method should make a copy of the student passed to the method, using the new operator A destructor which frees all memory that has been allocated using new A void printintoForlD(int id) method that prints out information for the student with the given id value Your class should be generic, that is, it should only refer to Student objects and not to the derived classes ResearchStudent and TaughtStudent. To achieve this objective you may need to add a method to the classes of questions 3, 4 and 5. If you do this, state what code you have added and why Your class must operate correctly when called using the following code in main: TaughtStudent s1(10801, "i11", "Murray") s1.registerFor("EE280"); s1.registerFor("EE281); ResearchStudent s2(20001, "Clever, cloggs""Prof. Knowalot", "Hard Sums"); StudentRegister studentRegister studentRegister.add (s1); studentRegister.add(s2); int studentID-20081; cout

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications 23rd International Conference Dexa 2012 Vienna Austria September 2012 Proceedings Part 1 Lncs 7446

Authors: Stephen W. Liddle ,Klaus-Dieter Schewe ,A Min Tjoa ,Xiaofang Zhou

2012th Edition

3642325998, 978-3642325991

More Books

Students also viewed these Databases questions

Question

=+ Does the message include a solution to overcome the fear?

Answered: 1 week ago