FINAL PROJECT NEED HELP
Hello guys, I have two issues, for one, I have been trying to fix my program so that if a wrong symbol is placed in by the user it would end the program entirely but only place in both "cout << "SORRY, PLEASE ONLY ENTER A SYMBOL LISTED ABOVE!";" and the while loop, because when, for example I put a exclamation mark instead of the symbols listed above it will still input the random numbers with that symbol and then affterrrr it would input the cout I typed above ^^, and two, when I actually do enter the right symbol and the right answer it would end the loop, only when I place an incorrect answer would it let me re run the program? what am i doing wrong??? thank you in advanced! // Created by Gabriel Reyes //C++ Program FINAL PROJECT //Gabriel Reyes, February 5, 2022 CIS-5 #include <iostream> #include <cmath> #include <ctime> //v1.2 using namespace std; int main() { char programerChoice = 'y'; do { srand(time(NULL)); //v1.2 char sym_choice; //Symbol Choice int one, two; char A_WAIT; //Answer to match with already generated problem cout << "\tHello, please Select A symbol to\n"; cout << "\tsolve a random math problem: \n"; cout << "\t(+,-,*,/)\n\n"; cout << "\tENTER YOUR CHOICE: "; cin >> sym_choice; // if (sym_choice == ('+'|| '-'|| '*'|| '/')) int answer = 0; bool CORRECT = false; one = rand() % 500 + 1; two = rand() % 500 + 1; std::cout << "What is " << one << " " << sym_choice << " " << two << "? "; cin >> A_WAIT; switch (sym_choice) { case '+': answer = one + two; CORRECT = true; break; case '-': answer = one - two; CORRECT = true; break; case '*': answer = one * two; CORRECT = true; break; case '/': answer = one / two; CORRECT = true; break; default: { cout << "SORRY, PLEASE ONLY ENTER A SYMBOL LISTED ABOVE!"; return 1; } } if (CORRECT == true) { cout << answer << "\n\nIf your Answer Matches then Nice job!" << endl; }