For this problem we will assume that all February months have 28 days and will not consider leap years) Write a program

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

For this problem we will assume that all February months have 28 days and will not consider leap years) Write a program

Post by answerhappygod »

For this problem we will assume that all February months have 28
days and will not consider leap years) Write a program that will
ask the user to enter their date of birth and realize if the inputs
are valid or not. The user must enter first the year (anything is
acceptable), then the month (values between 1 and 12 are
acceptable), then the day (acceptable values depend on the month).
You must write code so that after every input you check that the
input is ok. The year need not be checked but the month and day
should.
For This Problem We Will Assume That All February Months Have 28 Days And Will Not Consider Leap Years Write A Program 1
For This Problem We Will Assume That All February Months Have 28 Days And Will Not Consider Leap Years Write A Program 1 (226.59 KiB) Viewed 54 times
If they month is wrong, exit the program (don't even read the day). jenter the year: 1980 genter the month: 13 gWrong value for month. Program exiting! If the day is wrong, exit the program (don't continue). Henter the year: 1980 enter the month: 8 enter the day: -8 Wrong value for day. Program exiting! enter the year: 1980 lenter the month: 8 jenter the day: 32 Wrong value for day. Program exiting! If values are acceptable write code to calculate the age of the user (given that the current year is 2022). Then depending on the calculating age output the following If the age is less than one then lenter the year: 2023 enter the month: 3 enter the day: 3 Wrong year entered you cannot be -1 years old, that's not possible If the age is less than eight then enter the year: 2019 enter the month: 3 enter the day: 3 No way you can read and write, you are only 3 years old. If the age is less than 71 then enter the year: 1970 enter the month: 4 enter the day: 20 Thanks, just so you know you are 52 years old. If the age is less than 101 then enter the year: 1930 enter the month: 3 enter the day: 3 Should you be working with computers at 92 years old? And finally, if age is 101 or more lenter the year: 1900 enter the month: 3 enter the day: 3 You must have entered the wrong year, according to my calculations you are 122 years old. Are you sure this is accurate?
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply