The program takes three inputs from the user: day, month and year, and calculates the next date. Think of all possible scenarios, for example: • If the user has entered the last date of the year as input, the next day should be the first of January from the next year • Similarly, if the user has entered some date of February, make sure it checks for the leap year before calculating the next day • Then there are some months with only 30 days and some with 31 so that must be managed too • Neither of the inputs can be less than or equal to zero • Make sure the inputs are in their valid range, like months range from 1 to 12, etc Function Description You have to create the following functions: 1. get date format takes three arguments: day, month and year. It creates a string for the given date in the form: DD-MM-YYYY and returns the string. Make sure the empty spaces are filled with zeros to get the right format of the date 2. get next date takes three arguments: day, month and year. It calculates the next day according to the Gregorian calendar, and then calls the get date format function to get the date in the right format (DD-MM- YYYY) and print it according to the output message 3. main program should input three numbers from the user (day, month and year), and for each input, check if the number is a positive integer or not. If not, it should print a message stating: "Input can be a positive integer only. Try Again!" and continue until the correct input is received. In addition to checking for positive values, it should also check for valid ranges of the inputs, and if out of range, it should print a message stating: "Need valid date range. Try again!" and continue until the correct input is received. Repeat the process for all three inputs. Once the inputs received are correct, make sure the error checking for correct date is handled. If all is fine, then it should first print the current date using the format as received from get date_format and then call the get next_date function to print the next date. For all the error checking messages, refer to the outputs of the sample test cases.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Python 3 code required.

Please define all functions. Thanks 

 

Language: Python 3
C Autocomplete
30
2
2016
1
# Enter your code here.
2
Sample Output
3 vif name ==
__main__":
4
main()
February has upto 29 days in a leap year
Explanation
If the input is incorrect, it should print the error message, and end the program without performing any
calculations
v Sample Case 2
Sample Input For Custom Testing
29
2
2005
Sample Output
February has upto 28 days in a non-leap year
Explanation
If the input is incorrect, it should print the error message, and end the program without performing any
calculations
v Sample Case 3
Sample Input For Custom Testing
31
4
2020
Sample Output
This month can have upto 30 days only
Test
Custom
::::::
Transcribed Image Text:Language: Python 3 C Autocomplete 30 2 2016 1 # Enter your code here. 2 Sample Output 3 vif name == __main__": 4 main() February has upto 29 days in a leap year Explanation If the input is incorrect, it should print the error message, and end the program without performing any calculations v Sample Case 2 Sample Input For Custom Testing 29 2 2005 Sample Output February has upto 28 days in a non-leap year Explanation If the input is incorrect, it should print the error message, and end the program without performing any calculations v Sample Case 3 Sample Input For Custom Testing 31 4 2020 Sample Output This month can have upto 30 days only Test Custom ::::::
3 vif --name__
_main__":
4
main()
The program takes three inputs from the user: day, month and year, and calculates the next date. Think of
all possible scenarios, for example:
• If the user has entered the last date of the year as input, the next day should be the first of January from the
next year
• Similarly, if the user has entered some date of February, make sure it checks for the leap year before calculating
the next day
• Then there are some months with only 30 days and some with 31 so that must be managed too
• Neither of the inputs can be less than or equal to zero
• Make sure the inputs are in their valid range, like months range from 1 to 12, etc
Function Description
You have to create the following functions:
1. get date_format takes three arguments: day, month and year. It creates a string for the given date in the
form: DD-MM-YYYY and returns the string. Make sure the empty spaces are filled with zeros to get the right
format of the date
2. get next_date takes three arguments: day, month and year. It calculates the next day according to the
Gregorian calendar, and then calls the get date_format function to get the date in the right format (DD-MM-
YYYY) and print it according to the output message
3. main program should input three numbers from the user (day, month and year), and for each input, check if
the number is a positive integer or not. If not, it should print a message stating:
"Input can be a positive integer only. Try Again!" and continue until the correct input is received. In addition
to checking for positive values, it should also check for valid ranges of the inputs, and if out of range, it should
print a message stating: "Need valid date range. Try again!" and continue until the correct input is received.
Repeat the process for all three inputs. Once the inputs received are correct, make sure the error checking for
correct date is handled. If all is fine, then it should first print the current date using the format as received from
get_date_format and then call the get next_date function to print the next date. For all the error checking
messages, refer to the outputs of the sample test cases.
::::::
Transcribed Image Text:3 vif --name__ _main__": 4 main() The program takes three inputs from the user: day, month and year, and calculates the next date. Think of all possible scenarios, for example: • If the user has entered the last date of the year as input, the next day should be the first of January from the next year • Similarly, if the user has entered some date of February, make sure it checks for the leap year before calculating the next day • Then there are some months with only 30 days and some with 31 so that must be managed too • Neither of the inputs can be less than or equal to zero • Make sure the inputs are in their valid range, like months range from 1 to 12, etc Function Description You have to create the following functions: 1. get date_format takes three arguments: day, month and year. It creates a string for the given date in the form: DD-MM-YYYY and returns the string. Make sure the empty spaces are filled with zeros to get the right format of the date 2. get next_date takes three arguments: day, month and year. It calculates the next day according to the Gregorian calendar, and then calls the get date_format function to get the date in the right format (DD-MM- YYYY) and print it according to the output message 3. main program should input three numbers from the user (day, month and year), and for each input, check if the number is a positive integer or not. If not, it should print a message stating: "Input can be a positive integer only. Try Again!" and continue until the correct input is received. In addition to checking for positive values, it should also check for valid ranges of the inputs, and if out of range, it should print a message stating: "Need valid date range. Try again!" and continue until the correct input is received. Repeat the process for all three inputs. Once the inputs received are correct, make sure the error checking for correct date is handled. If all is fine, then it should first print the current date using the format as received from get_date_format and then call the get next_date function to print the next date. For all the error checking messages, refer to the outputs of the sample test cases. ::::::
Expert Solution
steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Knowledge Booster
Function Arguments
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education