help figuring out this program and typing it in c++

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Need help figuring out this program and typing it in c++.

1)
Write a program prompts a user to enter two dates - their birth date and the current date. Use these inputs to calculate
and print their age. Run this entire program in an infinite loop (while (true)).
2)
I require this program to use the following two (2) functions:
a)
The first function should be named isValidDate.
It should return a boolean (true/false) value, and it should be called repeatedly in a loop until a user enters a valid date.
It should take three (3) arguments - the values the user input for the day, month, and year.
This function should be used to check the validity of both the current date and the birth date.
For simplicity, you can use the following conditions to determine if the date is "valid":
i)
The day should not be greater than 31 (no month has more than 31 days).
Again, for simplicity, I won't ask you to deal with which month has a certain number of days, leap years, etc.
ii)
The month should not be greater than 12.
iii)
The year should be between 1900 and 2022 (no birth date before 1900 and we are not going into the future).
Transcribed Image Text:1) Write a program prompts a user to enter two dates - their birth date and the current date. Use these inputs to calculate and print their age. Run this entire program in an infinite loop (while (true)). 2) I require this program to use the following two (2) functions: a) The first function should be named isValidDate. It should return a boolean (true/false) value, and it should be called repeatedly in a loop until a user enters a valid date. It should take three (3) arguments - the values the user input for the day, month, and year. This function should be used to check the validity of both the current date and the birth date. For simplicity, you can use the following conditions to determine if the date is "valid": i) The day should not be greater than 31 (no month has more than 31 days). Again, for simplicity, I won't ask you to deal with which month has a certain number of days, leap years, etc. ii) The month should not be greater than 12. iii) The year should be between 1900 and 2022 (no birth date before 1900 and we are not going into the future).
10-05-2000 10-19-2022
Note that two different user ages have been calculated here and a third user is prompted in the final line (remember
that I asked you to run this age calculator in an infinite loop).
01-02-2003 10-19-2022
Enter CURRENT month, day, and year
10
19
2022
Age is: 19
Enter birth month, birth day, and birth year:
10
20
1990
2)
Before submission, run and test your program with (at least) the following 4 input pairs (birth date on left, current date
on right):
10-20-1990 10-19-2022
11-19-2021 10-19-2022
Enter CURRENT month, day, and year
10
19
2022
Age is: 31
Enter birth month, birth day, and birth year:
3)
Submit the cpp file.
Note that I give these in MM-DD-YYYY format only in an effort to increase readability here. Your user inputs can be in
the form shown in the sample output screenshots (enter month, day, and year separately and store in separate integer
variables).
Transcribed Image Text:10-05-2000 10-19-2022 Note that two different user ages have been calculated here and a third user is prompted in the final line (remember that I asked you to run this age calculator in an infinite loop). 01-02-2003 10-19-2022 Enter CURRENT month, day, and year 10 19 2022 Age is: 19 Enter birth month, birth day, and birth year: 10 20 1990 2) Before submission, run and test your program with (at least) the following 4 input pairs (birth date on left, current date on right): 10-20-1990 10-19-2022 11-19-2021 10-19-2022 Enter CURRENT month, day, and year 10 19 2022 Age is: 31 Enter birth month, birth day, and birth year: 3) Submit the cpp file. Note that I give these in MM-DD-YYYY format only in an effort to increase readability here. Your user inputs can be in the form shown in the sample output screenshots (enter month, day, and year separately and store in separate integer variables).
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 3 images

Blurred answer
Knowledge Booster
ADT and Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education