Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Your program should: Prompt the user for their date of birth. The user should enter the month, followed by the day, followed by the year
Your program should: Prompt the user for their date of birth. The user should enter the month, followed by the day, followed by the year 1. Prompt the user for the current date - the date when the age will be calculated 2. 3. 4. The user should enter the month, followed by the day, followed by the year Your program should calculate the age the person would be in years, months, and days then output the result. You should validate all user input. As an example: a. month is between 1 - 12 b. day does not exceed the number of days in the birth month c. if month is 2 and day is 29, is the year a leap year d. year is not less than 1900 the birth year is less that the current or desired year any other check you deem necessary e. f. Sample Run of the program: Enter the month of your birth: 3 Enter the day of your birth: 10 Enter the year of your birth: 1990 Enter the desired month: 1 Enter the desired day: 20 Enter the desired year: 2010 On January 20, 2010 you are 19 years, 10 months, and 10 days old. NOTE: The output for the month is a string rather than a decimal
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started