Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
NumDays Class
Design a class called NumDays. The classs purpose is to store a value that represents a
number of work hours and convert it to a number of days. For example, hours would
be converted to day, hours would be converted to days, and hours would
be converted to 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 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
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started