Make a 'Date' class, where a user can declare a date object with integers (dd,mm,year) or other format like (12 sep 2013). The class will be able to show the date in (dd/mm/year) format. Given a date, it can calculate difference from another date,(d1-d2). [ for example, 25/12/2013 – 13/12/2010] Given a date d1, it will be also able to add days to calculate a future date, [ for example, current date is 25/12/2013, and add 75 days to this date, get the result date] It can also check if two dates are equal or not, if d1 == d2??, [ for example, d1 is 25/12/2013, and d2 is 25 Dec 2013, program checks that the d1 and d2 are same]
Comments
Leave a comment