Question 0 (0 points): The Course Struct and Schedule Class First, create a Course struct with the members described below. This struct will be used in your Schedule class. Course Members: Attribute Description string : number The Course number, e.g. CSCI 1300 int : hours The Course credit hours Hint: You should include the definition of the course struct in your schedule.h file. See the background section on Structs and Classes for more information. The following questions will guide you through creating the Schedule class, which is described below: Data Members (private) Data Members Description string studentName The student's name. int enrolledHours The total number of credit hours the student is enrolled in. vector<Course> available A vector of Courses available for the student to enroll in. vector<Course> enrolled A vector of Courses that the student is enrolled in.
Member Functions (public) Member Functions Description Parameterized Constructor Set studentName to the string parameter and enrolledHours to 0. getStudent Name Returns the student Name member variable. getEnrolledHours Returns the enrolledHours member variable. loadCourses(string) Takes a string (the name of the file to be read) and populates the available vector with Courses. Returns true if the Courses were loaded successfully and false otherwise. displayAvailableCourses Displays the Courses listed in the available vector, one per line. Returns void . addCourse(string) Takes a string (the Course number) and adds the Course to the enrolled vector. Returns -1 if the Course does not exist, О if the student is already enrolled in the maximum number of hours, and 1 if the student was successfully enrolled in the Course. dropCourse(string) Takes a string (the Course number) and removes the Course from the student's enrollment. Returns false if the student was not enrolled in the Course or if the Course doesn't exist and true otherwise. writeSchedule(string) Takes a string (the path to the file) and writes the student's schedule to a file. Returns false if the file cannot be opened, and true otherwise.
Question 0 (0 points): The Course Struct and Schedule Class First, create a Course struct with the members described bel
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Question 0 (0 points): The Course Struct and Schedule Class First, create a Course struct with the members described bel
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!