Question: using python 3 Program 8- Using Python's DateTime Module Part 1: Create a function calcDiff that takes 2 parameters of type date and returns the
using python 3
Program 8- Using Python's DateTime Module Part 1: Create a function calcDiff that takes 2 parameters of type date and returns the difference of the dates. Note that the function should NOT print anything! Create a loop that Asks the user to enter a year, month, and day. Call the calcDiff function with today's date and the date entered by the user. Print the # of days AND the # of years that have passed. The loop should end when the usertypes END for the year. Reminders: Perform error-checking to ensure that the user enters only digits for each of the inputs (year, month, day) create a function getValidEntry that does the error checking. If the entry is not all digits, continue to ask the user for an entry until only digits are entered. Make sure your function does NOT return a negative number! Part 2: Create a function calcLateFee that takes 2 parameters of type dueDate, curDate (both are objects of type date) and dailyFee (a float). It should return the amount to be assessed as the late fee. curDate can be any date - do NOT assume it is today's date! dailyFee should be a float that indicates the amount per day to be charged if curDate - dueDate yields a negative number or 0, the function should return 0 as the amount. Scoring Guide: Part 1 (10 pts) - calcDiff takes 2 parameters, returns difference of the dates (4 pts). checks to make sure a negative # isn't returned -2 if no check prints # of days (2 pts) prints # of years (2 pts) Loops continuously until user types END (2 pts) Missing error checking on entries for yr, month, day -2 Part 2 (10 pts) calcLateFee takes 2 date objects as params and daily fee (float). Returns total late fee or 0 if no late feeStep by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
