Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ (The Course class) Revise the Course class implementation in , Course.cpp, as follows: When adding a new student to the course, if the array

C++ (The Course class) Revise the Course class implementation in image text in transcribed, Course.cpp, as follows:

When adding a new student to the course, if the array capacity is exceeded, increase the array size by creating a new larger array and copying the contents of the current array to it.

Implement the dropStudent function.

Add a new function named clear() that removes all students from the course.

Implement the destructor and copy constructor to perform a deep copy in the class.

Write a test program that creates a course, adds three students, removes one, and displays the students in the course.

#1 nclude O Stream 2 #include "Course.h" 3 using namespace std; 5 Course: Course Cconst string& courseName, int capacity) 6 7 numbe rofStudents 0 8 this courseName course Name 9 this capacity capacity 10 students new string capacity] 11 12 13 Course: Course C) 14 15 delete D] students 16 17 18 string Course: agetCounseNameo const 19 200 return course Name 21 22 23 void Course addstudent const string& name) 24 25 students Inumber0fStudents] name 26 number 0fStudents 27 28 29 void Course dropStudentCconst string& name) 30 1 31 Left as an exercise 32 33 34 string* Course: getStudents O const 35 1 36 return students 38 39 int Course getNumberofStudentsC) const 40 41 return numberofStudents 42

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 Design Application Development And Administration

Authors: Mannino Michael

5th Edition

0983332401, 978-0983332404

More Books

Students also viewed these Databases questions

Question

How effective have these groups been in the past?

Answered: 1 week ago

Question

1. What are the peculiarities of viruses ?

Answered: 1 week ago

Question

Describe the menstrual cycle in a woman.

Answered: 1 week ago

Question

=+ Of the HR issues mentioned in the case,

Answered: 1 week ago