Question: PLEASE READ Hello, we are working on writing and understanding simple C++ programs. I need help understanding the following question so that I can do


PLEASE READ Hello, we are working on writing and understanding simple C++ programs. I need help understanding the following question so that I can do problems like it on my own. Please include explanations. Thank you! 1. (military2.cpp) Make a program that will display one of the messages below depending on the gender and age the user enters Gender Age Morm 16 or youngerYou need to wait X more years. (if 15, 2 more years) Morm Between 17 and 42 The military is hiring more people like you. Morm 43 or older F or f Message Thank you for using the system Thank you for using the system, but we were only looking for men. Notice that we are allowing the user to enter 'f' and 'm' (lowercase) as well as 'F' and 'M (uppercase) for a gender. Ask for an age only if the gender is male. Use the following structure. if(male) If the user enters an invalid age (negative number), tell him "invalid age" and the program should end (no need to ask for a new age) else if(female) else //The user entered a letter other than M, m, F or f return 0; //end of program Use the following test cases to test your progranm Genger Age Message Invalid age 15You need to wait 2 more years. 17The military 43Thank you for using the system. is hiring more people like you. Thank you for using the system, but we were only looking for men Thank you for using the system, but we were only looking for men Invalid gender
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
