Question: In C++ Course.cpp Course.h Rewrite the addStudent function in the Course class in Listing 11.16, Course.cpp to throw a runtime_error if the number of students

In C++

Course.cpp

In C++ Course.cpp Course.h Rewrite the addStudent function in the Course class

Course.h

in Listing 11.16, Course.cpp to throw a runtime_error if the number of

Rewrite the addStudent function in the Course class in Listing 11.16, Course.cpp to throw a runtime_error if the number of students exceeds the capacity. Also, complete coding the function dropStudent. \#ifndef COURSE_H \#define COURSE_H \#include using namespace std; class Course public: Course(const string\& courseName, int capacity); Course(); // Destructor string getCourseName() const; void addStudent(const string\& name); void dropstudent(const string\& name); string* getstudents() const; int getNumberofstudents() const; private: string courseName; string* students; int numberofStudents; int capacity; \}; \#endif

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!