Originally Posted by
matsp
Regarding the date-class, I would probably have a "date-time" class that goes to at least minutes (if not seconds).
I would also consider that the date/time is one unit - you don't set the month only. So your set/get function should take all the day, month, year, hour, minute (and second) as parameters. A getter may want to exist to get only month or some such, but for setter, you set all at once.
[But you may not care if the car is picked up at 00:01 and returned at 23:59 on the same day, and thus "free" to rent because it was out "no days", when in fact it was out 23h58m].
I would also recommend that you store the date/time as one integer (e.g. a 64-bit number representing seconds for 1st Jan 2000 or some such). It makes calculating date/time differences (which you probably will need to do if you are doing car-rentals) much easier. If you don't do that, then you will still need a function to either subtract one date from another and give the result in number of days.
Mats