Question: pseudocode for the following # Function: This program determines if a date entered by the user is valid. # Input: Interactive # Output: Valid date
pseudocode for the following
# Function: This program determines if a date entered by the user is valid.
# Input: Interactive
# Output: Valid date is printed or user is alerted that an invalid date was entered.
validDate True
MINYEAR
MINMONTH
MAXMONTH
MINDAY
MAXDAY
# Get the year, then the month, then the day
year intinputEnter the year:
month intinputEnter the month :
day intinputEnter the day :
# Check to be sure date is valid
if year MINYEAR: # invalid year
validDate False
elif month MINMONTH or month MAXMONTH: # invalid month
validDate False
elif day MINDAY or day MAXDAY: # invalid day
validDate False
# Test to see if date is valid and output date and whether it is valid or not
if validDate:
printfmonthdayyear is a valid date."
else:
printfmonthdayyear is an invalid date."
Step 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
