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.
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
Related questions
Question
Python 3 code required.
Please define all functions. Thanks
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 4 steps with 1 images
Knowledge Booster
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.Recommended textbooks for you
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)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
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)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education