CSE 1325 Homework 4 solved (Copy)

$30.00

Category: You will Instantly receive a download link for .zip solution file upon Payment

Description

5/5 - (8 votes)

Part 1 – Course
For the Course class, you will need to add a new function for operator==. This function returns true if
the Course Prefix, number, and section number are the same. Alternatively, you may choose to
implement a != function in place of or in addition to the == function.
Part 2 – Catalog
The Catalog is a list of all the Courses being offered by institutions. It can also perform various functions
such as adding classes to the list viewing lists of courses, changing instructors, and
adding/removing/viewing students from courses.
Variables
• courses – a vector containing a list of all the courses SORTED by Course Prefix, then number,
then section number
• Ignore the new_attribute line. That is something with umbrello that I could not fix at the time of
uploading this.
Functions
• Catalog – Default Constructor
• add_course – Adds the course to the list of Courses, if the list is not already listed (a course with
the same course prefix, course number, and section number). The list of courses must stay
sorted.
• remove_course – Removes the course from the list of Courses. If no course present, nothing
happens
• view_all_courses – view all courses in the list (do not show the list of students)
• view_all_courses_of_prefix – view all courses in the list that have the prefix, such as only show
CSE courses (do not show the list of students)
• view_all_sections_of_course – view all sections in the list of a course, such as only show sections
of CSE 1325 (do not show the list of students)
• change_instructor – change the instructor of a course
• add_student – adds the student id to the list of student ids for that course. If course is not
present, nothing happens. If student is already enrolled in course, do not add the student
• remove_student – removes the student id from the list of student ids from the course. If course
is not present, nothing happens.
• view_students_in_course – shows all information about a course, including the list of students
Part 3 – main.cpp
Have your main function do the following. This main is mainly testing all the functionalities we just
programmed above.:
• Create a catalog
• Add a course to a catalog
• Display all the courses
• Add 4 more courses (one should fail, try to use different course prefixes/numbers and section
numbers)
• Display all the courses
• Remove a course for the list
• Display all the courses
• View all the courses of a prefix that’s present in your list
• View all sections of a course that’s present in your list
• Change the instructor of one of the courses
• Display all the courses
• Add multiple students to a course (some successful, some not)
• Display the students (all info) in the course
Part 4 – makefile
You are REQUIRED to provide a simple makefile that can build AND execute your program given the
command “make”. The only command the GTA will type is “make” to run and execute your program.
Deliverables
You will submit your code via Canvas. You will upload a zip file, named “abc1234_HW4.zip”, containing
the following file structure:
• abc1234
o abc1234_Course.h & abc1234_Course.cpp
o abc1234_Catalog.h & abc1234_Catalog.cpp
o abc1234_main.cpp
o makefile
Full credit files named incorrectly will result in a loss of 5 points each. Failure to follow proper file
structure will result in a loss of 5 points.