if(choice 1)
do thing 1
if(choice 2)
do thing 2
if(choice 3)
do thing 3
... this type of situation is exactly what the "else if" is for ... and also the switch statement ...
basically ... your if lines are testing each condition, and doing the one''s that match ..
here''s it rewritten with else ifs
if(choice 1) do thing 1else if(choice 2) do thing 2else if(choice 3) do thing 3else tell the user you did not understand their choice
this is jut like your code ... with 2 differences ...
1 - it''s more efficient, because once the computer sees that it has matched a choice, it quits trying to match other choices as well (the else if mean ONLY check if the previous ifs have failed ...)
2 - the else case can catch every situation that you haven''t handled, all at once ... so say they can enter any letter or number ... and you only handle 4 choices ... using else, you can write ONE block of code to handle all wrong choices the same ... easy ... perhaps a message like:
cout << "Command: " << d << " is unknown, please try again" << endl;