Question: Im confused about how to write a function to test whether it's valid input, pls use c++, thank you so much! The following shows a


Im confused about how to write a function to test whether it's valid input, pls use c++, thank you so much!
The following shows a sample output: (Note that your output may be a little different due to the randomly generated operands for math questions) (Note that the user input is shown in blue and represents the return key.) Do you want to practice three basic math operations? Press Enter to continue or press N(O) to quit... + 2 -- -- Please type your answer: eight Invalid input! Please try again... Please type your answer: I mean 8 Invalid input! Please try again... Please type your answer: 8 right? Congratulations! 8 is the right answer. Please type your answer: 4.5+ Congratulations! 4 is the right answer. 6 Please type your answer: twelve 12 right? Invalid input! Please try again... Please type your answer: 12 12 Congratulations! 12 is the right answer Do you want to practice three basic math operations? Press Enter to continue or press N(O) to quit... Sure + 2 ----- Please type your answer: 9nine Congratulations! 9 is the right answer. - 2 Please type your answer: 5. 4ok? Congratulations! 5 is the right answer. Please type your answer: 12 Sorry, the correct answer is 14. Do you want to practice four basic math operations? Press Enter to continue or press N(0) to quit...no Thank you for practicing Basic Math Operations
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
