Assignment 1
Write a program that reads the current date from the user in 10/3/2017 format and then generates a random date such as 9/30. Make sure you use correct limits for the number of days for each month when generating the date. For example, 9/30 is valid, but not 9/31. To check for the month of February, use the current year entered by the user, since the number of days in February depends on if the year is leap year or not. Months 1, 3, 5, 7, 8, 10 and 12 are 31 days, month 2 is 29 days in a leap year and 28 in a non leap year and the rest of the months are 30 days. A year is a leap year if it’s divisible by 400 or if not, it’s divisible by 4 but not 100.
If the generated date is the same as one of the following dates, generate another date: 1/1, 7/4, 11/25 and 12/25. If the second generated date is again the same as one of those dates, let it be.
Example:
Enter current date: 10/3/2016
Generated 9/15
Press any key to continue.
Another example:
Enter current date: 4/13/2016
Generated 2/29
Enter your date of birth (4 digits): 11/03
Your birthday is November 3.
Press any key to continue.
TO GET THIS OR ANY OTHER ASSIGNMENT DONE FOR YOU FROM SCRATCH, PLACE A NEW ORDER HERE
