Question: Please solve the following code in C++ step by step solution Catalog.h /* CECS 2223, Computer Programming II Lab Winter 2021, Sec. 05 Date: January
Please solve the following code in C++ step by step solution
Catalog.h
/* CECS 2223, Computer Programming II Lab Winter 2021, Sec. 05 Date: January 12, 2022 Topic: Lab 6 - Composition File name: Catalog.h Name: [YOUR NAME HERE], ID#[YOUR ID NUMBER HERE] Complete the C++ code as required */
class Catalog{ private: string universityName; int count; Course** courses; public: Catalog(); Catalog(string); ~Catalog(); void setName(string); int getCount() const; string getName() const; bool findCourse(string) const; void addCourse(string,string,int); void dropCourse(string); void orderCatalog(); void printCatalog() const; };
Catalog.cpp
/* CECS 2223, Computer Programming II Lab Winter 2021, Sec. 05 Date: January 13, 2021 Topic: Lab 6 - Composition File name: Catalog.cpp Name: [YOUR NAME HERE], ID#[YOUR ID NUMBER HERE] Complete the C++ code as required */ // the default constructor assigns the empty string, "", to strings and -1 to count // the Course pointer is initialized to nullptr Catalog::Catalog() { } Catalog::Catalog(string){ }
// the destructor prints the phrase // "Catalog for [name] has been destroyed" Catalog::~Catalog(){ } void Catalog::setName(string) { } int Catalog::getCount() const { } string Catalog::getName() const { }
// adds a course to the catalog // creates the Course object void Catalog::addCourse(string,string,int) { }
// drops a course from the catalog // invokes the Course object's destructor void Catalog::dropCourse(string);
// orders courses alphabetically by code void Catalog::orderCatalog();
// prints the list of all courses in the catalog // starts with the phrase // "[name] has [count] courses in the catalog, they are:" void Catalog::printCatalog() const;
Course.h
/* CECS 2223, Computer Programming II Lab Winter 2021, Sec. 05 Date: January 12, 2022 Topic: Lab 6 - Composition File name: Course.h Name: [YOUR NAME HERE], ID#[YOUR ID NUMBER HERE] Complete the C++ code as required */ #include
Course.cpp
/* CECS 2223, Computer Programming II Lab Winter 2021, Sec. 05 Date: January 12, 2022 Topic: Lab 6 - Composition File name: Course.cpp Name: [YOUR NAME HERE], ID#[YOUR ID NUMBER HERE] Complete the C++ code as required */
// the default constructor assigns the empty string, "", to strings and -1 to credits Course::Course(){ }
// the parameterized constructor Course::Course(string,string,int) { }
// the destructor prints the phrase // "Course [code] has been destroyed" Course::~Course() { }
// sets the course name void Course::setName(string) { }
// sets the course code void Course::setCode(string){ }
// sets the credits for the course // value MUST be > -1 void Course::setCredits(int){ } string Course::getName() const { } string Course::getCode() const { } int Course::getCredits() const { }
// prints the course info in the format // courseCode - courseName, x credits void Course::printCourse() const { }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
