Question: Key goal: Understanding if clauses, and thinking logically ] Happy birthday Write a C++ program which asks the user to input three numbers at the
Key goal: Understanding "if" clauses, and thinking logically ] Happy birthday Write a C++ program which asks the user to input three numbers at the keyboard, namely his/her month/day/year of birth (example: 8 31 1992) and also input the current month/day/year (example: 73 2004), and which then outputs the user's current age in years, and if it's the user's birthday, also outputs "happy birthday". In our example, your program should output "age -11 Other examples: (1) if user enters 12 1 1950 and current date is 12 19 1999, computer should output age 49 (2) if user enters 3 3 2002 and current date is 3 1 2003, computer should output 'age 0" (some precocious kid, eh, to use a computer?) (3) if user enters 1 3 1883 and current date is 1 3 1917, computer should output "age 34 happy birthday Test your program on several inputs, including the three above, to make sure it is working correctly and is logically correct. Aote: No need to eror-check the input Let's assume the user enters correct information ie month is between 1 and 12 inclusive, the day is appropriate for the number of days in the month, etc ]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
