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

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 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
Get step-by-step solutions from verified subject matter experts
