Question: Exercise 7.2 (date.py, horoscope.py). First write the program date.py, which should take in a month, day of the month and year, and convert it to

 Exercise 7.2 (date.py, horoscope.py). First write the program date.py, which shouldtake in a month, day of the month and year, and convert

Exercise 7.2 (date.py, horoscope.py). First write the program date.py, which should take in a month, day of the month and year, and convert it to the corresponding day of the year. Assume that leap years exist. Check that each date is correct (ie. March 56, 2017 is incorrect). For incorrect dates the conversion function should return -1, and you should print an error from main. For both programs, use dictionaries to store whatever data you might need (the number of days in each month, etc.) For example: 1python3 date2.py 2 Type stop or enter a month, day, and year s > March, 14, 2015 Day of the year: 73 December, 14, 2016 Day of the leap year: 349 7 > Oktober, 91, 2015 s Invalid date entered. stop Use the following boolean expression to check if a year is a leap year or not

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!