Question: Goals Project 2 Practice using loops and conditional structures Practice the use of strings Description A close associate of yours is diligently working on




Goals Project 2 Practice using loops and conditional structures Practice the use of strings Description A close associate of yours is diligently working on a calendar project, a venture rich with both promise and complexity. During this meticulous process, they have encountered challenges in calculating exact dates, revealing hidden intricacies within the seemingly simple task. Recognizing your expertise in this area, they have reached out for assistance with the date calculator component. The following steps summarize the project tasks: 1. Task 0: program set up and add brief description comments in the header area. 2. Task 1 implementing successor (), predecessor () function 3. Task 2: implementing date_calculator () function. 4. Task 3: implementing schedule_dates () function Task 1: implementing successor(), predecessor() function. def successor (date): Parameters: date(String) The function returns the immediate successor of the given date in the form of string. def predecessor (date): Parameters: date(String) The function returns the immediate predecessor of the given date in the form of string. Description: Write functions that compute the immediate successor or predecessor of a given date. For example, if the user enters values that represent 8/23/2023 then successor () should display the day immediately after 8/23/2023, which is 8/24/2023; predecessor () should display the day immediately before 8/23/2023, which is 8/22/2023. If the user enters values that represent 8/31/2023 then successor () should indicate that the next day is 9/1/2023. And so on. Ensure that your functions work correctly for leap years, where there would be 29 days in February. The input date will be in string form with the format of Month/Day/Year. And the output should be in the exact same format as the input. Sample Output: >>> print (successor ("8/23/2023") ) 8/24/2023 >>> print (predecessor ("8/23/2023)) 8/22/2023 Task 2: implementing date_calculator () function. def date_calculator (date, difference): Parameters: date(string), difference (int) The function returns the exact date of the original date adding the difference. Description: In this function, the value of the difference could be either positive or negative. If it's positive, you need to calculate the exact date of the given date adding the absolute value of difference. If negative, you need to calculate the exact date of the given date subtracting the absolute value of difference. It's recommended to write this function with loops and the functions in task 1. Sample Output: >>> print (date calculator ("8/23/2023", -30)) 7/24/2023 Task 3: implementing schedule_dates () function def schedule_dates (start_day, end_day, interval): Parameters:start_day (string), end_day (string), interval (int) Description: The function prints all the dates between the start_day and the end_day with the specified interval (This means that you should exclude the start and end dates). The value of interval is positive. For example, if the start_day equals to 8/23/2023, the end_day equals to 9/20/2023, and the interval equals to 7, then the function would first print 8/30/2023, then 9/6/2023, finally ends with 9/13/2023. Sample Output: >>> schedule dates ("8/23/2023", "9/20/2023, 7) 8/30/2023 9/6/2023 9/13/2023
Step by Step Solution
There are 3 Steps involved in it
Program Plan Define functions calcAttendanceScore calcHomeworkScore calcMidtermScore calcFinalScore ... View full answer
Get step-by-step solutions from verified subject matter experts
