I am trying to implement a feature into my program that says "Do you want to quit?" If 'Y or 'y' exit the program. If 'N' or 'n' rerun the menu and let the user do whatever they want.
The issue that I am facing is that my menu runs the first time and the user can say yes or no. Then the second time they can say yes or no. However the third time when it reaches the while loop it infinitely outputs the menu.
Can anyone please advise?
The code for the menu is
char exitInput = NULL;
char Y = 'Y', y = 'y', N = 'N', n = 'n';
while (exitInput != Y || exitInput != y || exitInput == N || exitInput == n)
{
cout << "*\t Please choose one of the following options. \t *" << endl;
cout << "1. \t" << "Transfer an amount \n"
<< "2. \t" << "List recent transactions \n"
<< "3. \t" << "Display account details and current balance \n"
<< "4. \t" << "Quit \n";
int menuSelection;
cout << "Enter your option here: ";
cin >> menuSelection;
switch (menuSelection)
{
case 1:
.......
case 2:
cout << "Do you want to exit the application? ";
cin >> exitInput;
}
}