Please answer the ques in c++
1st image is the ques... last 2 image is for the output.Please make sure the code you are giving me the output runs same as the image (2 images) output.
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 factoria1 (n!). c) If option 2 is selected: - Request integer values for n and m 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, symbols, or floats. You may create your own factorial() and power () functions. But do not use any math functions such as pow (x,y) from library. Add comments to explain the algorithm of your program. Keep your project coding clear with your own programming style. MATH MENU MATH MENU 1. Calculate n ? n factorial. 1. Calculate n ? n factorial. 2. Calculate n to the n power. 2. Calculate n to the n power. 3. Exit progran. Please enter your selection: abc Invalid input. Please re-enter. 3. Exit program. Please enter your selection: 2 Enter an integer value for n 19: abc 1. Calculate n ? n factorial. Invalid input. Please re-enter. 2. Calculate n to the n power. Enter an integer value for n (19=1.1 3. Exit progran. Please enter your selection: 1.1 Invalid input. Please re-enter. Invalid input. Please re-enter. 1. Calculate n?n factorial. Enter an integer value for n(19=1 2. Calculate n to the n power. Enter an integer value for n19:ABC 3. Exit progran. Invalid input. Please re-enter. Please enter your selection: Pe\# Invalid input. Please re-enter. Enter an integer value for n (19:# 1. Calculate n ? n factorial. Invalid input. Please re-enter. 2. Calculate n to the n power. Enter an integer value for n19:2.2 3. Exit progran. Invalid input. Please re-enter. Please enter your selection: Enter an integer value for n 19:22 Invalid option. Please re-enter. Invalid input. Please re-enter. 2. Calculate n to the n power. Enter an integer value for n(19):2 3. Exit progran. Please enter your selection: 1 (19:ABC Enter an integer value for n19:3 Enter an integer ualue for n 19: ABC Invalid input. Please re-enter. Invalid input. Please re-enter. 2 . Calculate n to the nower. Enter an integer value for n19: \#\#\# 3. Exit program. Please enter your selection: 3 Invalid input. Please re-enter. Enter an integer value for n 19:2 Math is fun. Programning is even nore funt 21=2 1. Calculate n ? n factorial. 2. Calculate n to the n power. 3. Exit program. Please enter your selection: 3 Exit progran. Math is fun. Progranning is even nore funt MATH MENU 1. Calculate n ! n factorial. 2. Calculate n to the power. 3. Exit progran. Please enter your selection: 8 Invalid option. Please re-enter. 1. Calculate nf (n factorial). 2. Calculate n to the a power. 3. Exit progran. Please enter your selection: 1 Enter an integer value for n (19)=2.2 Invalid input. Please re-enter. Enter an integer value for n19=2 Invalid input. Please re-enter. Enter an integer value for n (19)2 21=2 1. Calculate n= (n factoria1). 2. Calculate n to the a power: 3. Exit progran. Pleace enter your selection: 2 Enter an integer value for n 19=1.1 Invalid input. Pleane recenter. Enter an integer value for n19=0 Enter an integer value for n19=11 Invalid input. Please re-enter. Enter an integer value for n19=18 Enter an integer value for n19=2 Invalid input. Please re-enter. Enter an integer walue for o (19=2 Enter an integer value for n (19)=3 2 to the power of 3=8 1. Calculate n1 (n factorial). 2. Calculate n to the a power. 3. Exit progran. Piease enter your zelection: 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 t (n factoria1). 2.. Calculate in to the a power: 3. Exit progran. Please enter your selection: 1 Enter an integer value for n(19=5 51=120 11. Calculate nt (n factorial). 2. Calculate n to the a power. 3. Exit progran. Please enter your selection: 3 Exit prograa. Math is fun. Progranning is even nore funt