Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

Course.h

image text in transcribed

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

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

More Books

Students also viewed these Databases questions

Question

7. Understand the challenges of multilingualism.

Answered: 1 week ago

Question

5. Give examples of variations in contextual rules.

Answered: 1 week ago