Assignment 1
Home ] Assignments CIS 162 ]

Complete problem 3.16 on page 88. Use correct style and JavaDoc comments. Include the Date class and a sample Driver class show the Date class in action. You may use console I/O only if you wish. Use the following test data in your driver. Turn in  hard copy of your code with sample output. Due in one week.

new Date(1,1,1800)
new Date(12,31,2500)
new Date(0,1,1800)
new Date(1,32,1800)
new Date(1,1,1700)
new Date(13,1,2000)
new Date(1,1,2600)

a = new Date(1,1,1804);
b = new Date(1,1,1805);
days1 = a.subtract(b);
days2 = b.subtract(a);

c = new Date(12,31,2500);
c = c.addDays(5);

d = new Date(2,28,2004);
d = d.addDays(2);

e = new Date(1,1,1800);
e = e.addDays(-2);

f = new Date(1,1,1804);
f.equals(a)
f.equals(b)

f.compareTo(a)
f.compareTo(b)
f.compareTo(d)