I need this by 4:00pm PST this afternoon.... 6 hours max!
1) Add overloaded << operators to output a ClockDigit and a Clock. They are necessary for the code in main(). Format the ouput for Clock so that it looks like hh:mm:ss.
2) Add day, month and year counters to the clock. To make it simpler, assume there are 30 days in each month, 12 months in each year and no leap years. We will continue to work with this example.
Here is the supplied code that needs to be modified to make the above work. Please make comments on the code to explain what was changed.
**class ClockDigit
{
public:
ClockDigit(int b, ClockDigit *n = 0)
:base(b), nextdigit(n), count(0) {}
void increment();
void Set(int i)
{
if ((i >= 0) && (i < base))
count = i;
}
int theCount() const {return count;}
private:
int count;
const int base;
ClockDigit* const nextdigit;
};
void ClockDigit::increment()
{
++count;
if (count >= base)
{
count = 0;
if (nextdigit != 0)
nextdigit->increment();
}
}
class Clock
{
friend ostream& operator<<(ostream& o, const Clock& mc);
public:
Clock()
:second(60, &minute),
minute(60, &hour),
hour(24) {}
void Set(int h, int m, int s)
{[login to view URL](h); [login to view URL](m); [login to view URL](s);}
void increment() {[login to view URL]();}
private:
ClockDigit second;
ClockDigit minute;
ClockDigit hour;
};
int main()
{
Clock CL;
[login to view URL](23, 59, 50);
for (int ii= 0; ii < 100; ii++)
{
cout << CL << endl;
[login to view URL]();
}
}**
## Deliverables
1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.
2) Deliverables must be in ready-to-run condition, as follows (depending on the nature of the deliverables):
a) For web sites or other server-side deliverables intended to only ever exist in one place in the Buyer's environment--Deliverables must be installed by the Seller in ready-to-run condition in the Buyer's environment.
b) For all others including desktop software or software the buyer intends to distribute: A software installation package that will install the software in ready-to-run condition on the platform(s) specified in this bid request.
3) All deliverables will be considered "work made for hire" under U.S. Copyright law. Buyer will receive exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site per the coder's Seller Legal Agreement).
## Platform
Visual C++