The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 408 Weeks Ago, 2 Days Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
Time Off
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:
maxSickDays A NumDays object that records the maximum number of days of sick leave the employee may take.
sickTaken A NumDays object that records the number of days of sick leave the employee has already taken.
maxVacation A NumDays object that records the maximum number of days of paid vacation the employee may take.
vacTaken A NumDays object that records the number of days of paid vacation the employee has already taken.
maxUnpaid A NumDays object that records the maximum number of days of unpaid vacation the employee may take.
unpaidTaken A NumDays object that records the number of days of unpaid leave the employee has taken.
Additionally, the class should have members for holding the employee’s name and identification number. It should have an appropriate constructor and member functions for storing and retrieving data in any of the member objects.
Programming Challenge 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 overloaded + 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 return the difference of the two objects’ hours members.
++ Prefix and postfix increment operators. These operators should 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.
Â
Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll