In previous chapters your code led a relatively simple life: You declared some constants and variables and then assigned them values. But of course, an application really comes to life – and programming becomes a bit more challenging – when the application makes decisions based on the contents of its variables. For example, a game may let players leap a tall building if they have eaten a power-up. You use conditional statements to help applications make these kind of decisions.
if/else statements execute code based on a specific logical condition.
You have a relatively simple either/or situation, and depending on the result one branch of code or another (but not both) runs.
Consider Knowhere, your ...