Compare and contrast if, if-else, and switch statements. What do they have in common and how are they different? When would you use each?
if and if-else statements, I use to give the user multiple options. In switch statements i use it to divide up the if statements being able to make rooms and actually have the player explore around the map that I created with Switch statements. In the switch statements i would have if statements asking the user questions or having them read a cout statement.
No comments:
Post a Comment