CS211 Homework 5 Solved




5/5 - (1 vote)

Modify your Student class to overload the following operators: ==, !=, <, >, <=, >= as member operators. The comparison operators will compare students by last name first name and id number. Also, overload << and >> as friend operators in the Student class. Overload << and >> operators in Roster class as well to output Rosters in a nice format as well as input Roster.

Provide a function sort in a Roster class as a private function to sort out all the students in a Roster according to their Last Name, First Name, and Student id using the comparison operators that you overloaded in the Student class (We will go over a simple selection sort on integers either in the lab or the lecture). Overload << and >> operators in Date class that I provided for you.

Change the date of birth and date of matriculation in the Student class from string to an instance of Date object. Change the functions and constructors in the Student class to set and get the Dates as Date objects rather than strings.

Write a driver program to test your functions.

Submit your homework to your lab instructor.

Due Date: November 21