is, I need the program to be able to return back to where you enter either L or S. The program works as long as the correct character is selected. What i need it to do is return to be able to input UserSelection when an invalid entry is entered. I know it has something to do with while loop but I haven't been able to make it work. Your help would be greatly appreciated.
I'm taking a beginners C++ class and the program required us to use if, else if and else statements. We just learned about switches last class, but I do realize that it would have been a lot easier and efficient using them. Thank you by the way.
@MaxDaniels
@LendraDwi
The if statement is correct with && because the conditions are !=.
If the value is other than L or S, you want the condition to be true.
Using || is incorrect. If the value is S, then != L will be true and the invalid entry logic will be executed. Likewise if the value is L, then != S will be true. This results in the invalid entry logic to be executed regardless of what was entered.