Also, just ignore all the "std::", I put them in at one point and didn't feel like removing them. |
Why would you remove them? It wouldn't work if you removed them.
when the wrong choice is selected the program terminates and I can't figure out why |
Your code looks like it's meant to terminate if the wrong choice is entered. What did you think was going to happen if, for example, the user enters "17" for "choice1"?
Let's also look at some plain bad code. Let's look at this line:
if (choice1 != 1 || choice1 != 2)
The conditional statement here is:
(choice1 != 1 || choice1 != 2)
This is an OR statement, so if either side is TRUE, then the whole thing comes out as TRUE.
Let's take a look at the left side.
choice1 != 1
This will be FALSE only in one case, right? When choice1 is "1".
Let's take a look at the right side.
choice1 != 2
This will be FALSE only in one case, right? When choice1 is "2".
So for both sides to be FALSE, you need choice1 to be 1, and also 2, at the same time. Is that possible? No.
Basically, you've written a condition that is true always.