Mini- Project of Dates
Your program should allow the user to enter day, month and year of any date after 1 Jan 1900. The program should allow user to enter two dates. The program should then determine whether two dates are in a leap year, whether the first date is earlier than the second date and display the results accordingly. The calendar of months of the dates should also be displayed as shown below. Program should have a class and functions for checking leap year, displaying calendar etc.

Enter Date[1]:3/7/1999
Date[1]: 3/7/1999
Date[1] is not in a leap year.

July, 1999 Sun Mon Tue Wed Thu Fri Sat
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31

Enter Date[2]:26/9/2000
Date[2]:26/9/2000
Date[2] is not in a leap year.
Date[1] is earlier than Date[2]

September, 2000 Sun Mon Tue Wed Thu Fri Sat
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30

Write a Date class with a constructor for initializing day, month and year of a date. Use the following rules for a leap year.
1. Years evenly divisible by 400 are leap years.
2. Years evenly divisible by 100 but not by 400 are not leap years.
3. Years evenly divisible by 4 but not by 100 are leap years.
4. Other years are not leap years.
Use the operator % to determine whether a year is divisible by a given number. X %Y operation will give the remainder of X/Y.
You may use Monday, 1 Jan 1900 as your reference.

this are what i have started and i need help to go on.Not sure if i'm correct but i'm doing basic OOP language in visual studio. Let me find my code ^_^!

Recommended Answers

All 2 Replies

this are what i have started and i need help to go on.Not sure if i'm correct but i'm doing basic OOP language in visual studio. Let me find my code ^_^!

Are you sure that you had started?
may be some googling lets you find some ready-to-deploy code...
except daniweb.com as far as i've seen.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.