Question: please answer in c++.. with showing the code output need to be like this ate a complete program that contains the following: a) Create a

ate a complete program that contains the following: a) Create a looping menu with the following options: 1. Calculate n! (n factorial). 2. Calculate n to the power of m. 3. Exit program. b) If option 1 is selected: - Request an integer value for n from 1 to 9 inclusive. - Validate that n is an integer. Re-enter n if n is not an integer. - Validate that n is less than 10 . Re-enter n if n is not in the range. - Calculate and output n factorial (n!). c) If option 2 is selected: - Request integer values for n and in from 1 to 9 inclusive. - Validate that n and m are both integers Re-enter n and m if one of them is not an integer. - Validate that both n and m are from 1 to 9 inclusive. Re-enter n and m if one of them is not in the range. - Calculate and output n to the power of m. d) If option 3 is selected: - Exit the program. e) If an invalid option is selected: - Inform the user with the error. ; Re-enter option. f) Use loops to create factorial and power operations: - Do not use library functions to do them. g) Use validate() function to validate all the input that is of improper type such as characters, synbols, or floats. You may create your own factorial() and power () functions. HATH MENU 1. Calculate n f n factorial\}. 2. Calculate n to the a power. 3. Exit progran. piease enter your selection: 8 Inualid option. Please re-enter. 1. Calculate n t {n factorial). 2. Calculate n to the n pover. 3. Exit progran. Piease enter your selection: 1 Enter an integer yalue for n(19):2.2 Invalid input. Please re-enter. Enter an integer value for n(19):2 Invalid input. Please re-enter. Enter an integer value for n (19)=2 21=2 1. Calculate nt {n factorial\}. 2. Calculate n to the n pover. 3. Exit progran. Please enter your selection: 2 Enter an integer value for in (19):1.1 Invalid input. Please re-enter. Enter an hyteger value for n (19):8 Enter an integer value for n(19)=11 Invalid input. Please re-enter. Enter an integer value for n(19):18 Enter an integer value for A(19:2 Invalid input. Please re-enter. Enter an integer value for n(19):2 Enter an integer value for n(19)=3 2 to the power of 3=8 1. Calculate nt (n factorial). 2. Calculate n to the n pover. 3. Exit progran. Please enter your selection: 2 Enter an integer value for n (19):5 Enter an integer value for n(19):5 5 to the power of 5=3125 1. Calculate n f {n factorial\}. 2.. Calculate n to the n pouer. 3. Exit progran. Please enter your selection: 1 finter an integer value for in (19)=5 51=128 1. Calculate nf \{n factera 1\}. 2. Calculate n to the n pouer. 3. Exit progran. Please enter your selection: 3 Exit prouran. Mach is fun. Progranning is even nare funt
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
