Final Examination CS 141 Friday, May 8, 1998 This is a closed-book, closed-notes examination. There are five problems. Do not spend too much time on any problem. Read them all through first and solve them in the order that allows you to make the most progress. For each of the problems, you need to write a function. You do not need to write comments or #include statements. Assume that the type bool already exists. Your program does not have to be fancy or user-friendly. You should make it as simple as possible, as long as it does what is required. ------------------------------------------------------------------------------ Problem 3 (20 points): A. Create a class called date, with data fields for month, day and year. They should all be integers. For month: 1 means January, 2 means February, etc. Look at the other parts of this question to see what else this class should contain. B. Write a member function called get_month to return the month. C. Write a member function called get_day to return the day. D. Write a member function called get_year to return the year. D. Write a nonmember function that takes two dates as parameters and returns true if the first date occurs before the second, false otherwise. ------------------------------------------------------------------------------ Problem 4 (20 points): This problem uses the class from Problem 3, and may use any of the functions from Problem 3. A. Write a class called date_list, containing an array of dates, and the amount of the array that is filled, as data fields. Look at the other parts of this question to see what else the class should contain. C. Write a member function called earliest, which returns the earliest date in the date_list. D. Write a member function called count_jan, which returns the number of dates in the date_list which are in January. ------------------------------------------------------------------------------