$18.00 Class Implementation Tutorial. Source Included. Does Everything Asked (And Probably More). Compiled Tested Commented
- This tutorial was purchased 1 time and hasn't been rated yet.
- Posted on Mar 18, 2009 at 9:11:10PM
A:
Preview: ... t;Preventive Maintenance Schedule For " << number << " " << name << endl;<br><br> cout << "From ";<br> starting.displayDate();<br> cout << " To ";<br> ending.displayDate();<br> cout << endl << endl;<br><br><br> outf << "From ";<br> starting.toOutStream(outf);<br> outf << " To ";<br> ending.toOutStream(outf);<br> outf << endl << endl;<br><br> //set a tempDate equal to the purchase date<br> Date tempDate = date;<br><br><br> /* So for your Date class, you don’t need the “compare” method, just the “adddays” method in class<br> date to compute maintenance schedule. This makes the program much simpler for you. Don’t forget,<br> you have to start the maintenance schedule for the purchase date and not March 1, 2009. You produce<br> the 5 months of scheduling from March 1, 2009.<br> */<br><br> //So basically we start the maintenance scheduling from the purchase date but<br> //don't print it out until today's date or after<br><br> int i = 0;<br><br> //while the temp date is less than the ending date keep adding the<br> //days inbetween and the time it takes for maintenance<br> while ((tempDate.getYear() <= ending.getYear()) &&<br> ((tempDate.getMonth() < ending.getMonth()) ||<br> ((tempDate.getMonth() == ending.getMonth()) && ending.getDay() < starting.getDay())))<br> {<br> //We only generate it from today's date to the ending date<br> if ((tempDate.getYear() >= starting.getYear()) &&<br> ((tempDate.getMonth ...
The full tutorial is about 1955 words long plus attachments and additional clarification.
Attachments:
main.cpp (7K) (Preview)