Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In C++ Course.h #lfndef COURSE H #de fine COURSE H #include #include using namespace std; class Course public: // Creates a course with the specified

In C++

image text in transcribedimage text in transcribed

Course.h #lfndef COURSE H #de fine COURSE H #include #include using namespace std; class Course public: // Creates a course with the specified name and maximum Course (const string& course name, int capacity); // Destructor, destory the dynamic array number of students allowed. Course) Returns the course name. string get_course_name ) const: // Adds a new student to the course if the array void add student (const string& new_student) // Drops the specified student capacity is not exceeded. void drop_student (const string& drop_student) // Returns the array of students for the course String* get students) const; Returns the number of students for the course. int get_number_of_students ) consti // Prints the course name, the number of students, and void print_course) const the added students. private: The name of the course string course_name; //An array of students who take the course. students is string* students; a pointer for the array. // The number of students (default: 0). int number_of_students: The maximum number of students allowed for the course. int capacity: #endif Write a test program that 1) creates a course (prompt the user to enter the course name and capacity) 2) adds students (prompt the user to enter the student name, stop adding the students when the user enter "exit" as student name) 3) removes the student (prompt the user to enter the student name to be removed, remove the student from the course), 4) displays the course name, the number of students, and students added in the course Four files should be submitted for this program question. 1) a header file Course.h which contains the definition of Course class, 2) an implementation file Course.cpp which contains the implementation of Course class, 3) a client test file alq9.cpp containing main() function, 4) a script file alq9result containing result. Here are the sample runs Enter the course name: CSE330 Enter the course capacity: 20 Enter the student name: Taylor The student is added Enter the student name: Jim The student is added Enter the student name: Alice The student is added Enter the student name: exit Enter the student that will be removed: Jim The student is removed The course information: CSE330 2 Taylor Alice

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 Processing

Authors: David J. Auer David M. Kroenke

13th Edition

B01366W6DS, 978-0133058352

More Books

Students also viewed these Databases questions

Question

What does this public not want on this issue?

Answered: 1 week ago

Question

what are the provisions in the absence of Partnership Deed?

Answered: 1 week ago

Question

1. What is called precipitation?

Answered: 1 week ago

Question

1.what is dew ?

Answered: 1 week ago

Question

1. Identify outcomes (e.g., quality, accidents).

Answered: 1 week ago