Question: Q2. [For Assessment. Will Be Marked.] You must click submit to submit your solution. Deadline is 11:59pm, Feb 14, 2023. Write a program that calculates
![Q2. [For Assessment. Will Be Marked.] You must click submit to](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f302db58e7b_01066f302dac6fea.jpg)
Q2. [For Assessment. Will Be Marked.] You must click submit to submit your solution. Deadline is 11:59pm, Feb 14, 2023. Write a program that calculates your age in future. The console's prompts for data entry and the output displayed should strictly follow the format of the expected output shown below. a) The program should cope with singulars and plurals properly in the output, e.g. "1 month" but " 2 months", and " 0 month" or " 0 year" can be in the output. b) The program should check for invalid month input. If an input number for month is not in the range from 1 to 12 , the program should print the message below and end. Invalid Month Input! c) The program should check for invalid age input. 1. If an input number for age is a negative integer, the program should print the message below and end. The value for age cannot be a negative integer! 2. If an input number for present age is larger than 200, the program should print the message below and end. Sorry, people may be dead by this age! d) The program should check that you were not born yet in the year and month for which you wish to know your age. The program should print the message below and end. You were not born! e) Given the calculated age X year(s) and Y month(s), the program should check the followings: 1. If both X and Y are odd, print the following message. Both of X and Y are odd! 2. If either X or Y is odd, print the number that is odd. For example, if X is odd, print the following message. x is odd! 3. If neither X nor Y is odd, print the following message. Both of X and Y are not odd! Hints: Verify the inputs before calculating the outputs
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
