Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Implement a main program that prompts the user and prints the classes you are taking this quarter. Use a dynamic array and functions with

C++

Implement a main program that prompts the user and prints the classes you are taking this quarter. Use a dynamic array and functions with arguments of class Course. b. Modify the Course, Instructor, and TextBook classes by adding attributes and member functions, discussed in class

#ifndef COURSE_H #define COURSE_H #include #include #include "Instructor.h" #include "TextBook.h" using namespace std; class Course { private: string courseName; // Course name string courseCode; string courseTerm; Instructor instructor; // Instructor TextBook textbook; // Textbook public: // Constructor

Course(); Course(string aCourseName, string aCourseCode, , string aCourseTerm, string instrLastName, string instrFirstName, string instrOffice, string textTitle, string author, string publisher); Course(string aCourseName, string aCourseCode, , string aCourseTerm, Instructor anIstructor, TextBook aTextBook); Course(const Course &obj); void set(string aCourseName, string aCourseCode, string aCourseTerm ,string instrLastName, string instrFirstName, string instrOffice, string textTitle, string author, string publisher); void set(string aCourseName, string aCourseCode, string aCourseTerm, Instructor anIstructor, TextBook aTextBook); void setCourseName(string aCourseName); void setCourseCode(string aCourseCode); void setCourseTerm(string aCourseTerm); void setInstructor(Instructor anIstructor); void setInstructor(string instrLastName, string instrFirstName, string instrOffice); void setTextBook(TextBook aTextBook); void setTextBook(string textTitle, string author,string publisher); string getCourseName() const; string getCourseCode() const; string getCourseTerm() const; Instructor getInstructor() const; TextBook getTextBook() const; friend ostream &operator << (ostream &strm, const Course &obj); friend istream &operator >> (istream &trm, Course &obj); }; #endif +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #ifndef INSTRUCTOR_H #define INSTRUCTOR_H #include #include using namespace std; // Instructor class class Instructor { private: string lastName; // Last name string firstName; // First name string officeNumber; // Office number public: // The default constructor stores empty strings // in the string objects. Instructor(); // Constructor Instructor(string lname, string fname, string office); Instructor(const Instructor &obj); // set function void set(string lname, string fname, string office); void setLastName(string lname); void setFirstName(string fname); void setOfficeNumber(string office);string getLastName() const; string getFirstName() const; string getOfficeNumber() const; friend ostream &operator << (ostream &strm, const Instructor &obj); friend istream &operator >> (istream &trm, Instructor &obj); }; #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

DATABASE Administrator Make A Difference

Authors: Mohciine Elmourabit

1st Edition

B0CGM7XG75, 978-1722657802

More Books

Students also viewed these Databases questions