Question: Write a program to accomplish Programming Challenge #5 Time Off & overload the six relational operators comparisons should be done based on the total number
Programming Challenges dd the following overloaded operators efix and postfix increment operators. These operators should modify the DayOfYear object so it represents the next day. If the day is already the end the year, the new value of the object will represent the first day of the year. prefix and postfix decrement operators. These operators should modify the DayofYear object so it represents the previous day. If the da first day of the year, the new value of the object will represent the last day of the year y is already the 4. NumDays Class Design a class called NumDays. The class's purpose is to store a value that represents a number of work hours and convert it to a number of days. For example, 8 hours would be converted to 1 day, 12 hours would be converted to 1.5 days, and 18 hours would be converted to 2.25 days. The class should have a constructor that accepts a number of hours, as well as member functions for storing and retrieving the hours and days. The class should also have the following overloaded operators: . Addition operator. When two NumDays objects are added together, the over- loaded+ operator should return the sum of the two objects' hours members. Subtraction operator. When one NumDays object is subtracted from another, the overloaded- operator should rerurn the difference of the two objects' hours .Prefix and postfix increment operators. These operators Id increment the number of hours stored in the object. When incremented, the number of days should be automatically recalculated. Prefix and postfix decrement operators. These operators should decrement the number of hours stored in the object. When decremented, the number of days should be automatically recalculated. 5. Time Off NOTE: This assignment assumes you have already completed Programming Challenge 4. Design a class named TimeOff. The purpose of the class is to track an employee's sick leave, vacation, and unpaid time off. It should have, as members, the following instances of the NumDays class described in Programming Challenge 4: A NumDays object that records the maximum number of days of sick leave the employee may take. A NumDays object that records the number of days of sick leave the employee has already taken. A NumDays object that records the maximum number of days of paid vacation the employee may take. A NumDays object that records the number of days of paid vacation the employee has already taken. maxSickDays sickTakern saxVacation vacTaken
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
