Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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; \}; \#endifStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started