I would not use absolute value myself. If the person enters -5 they should be told they're not doing it correctly.
Quote:
Originally Posted by Kristi
Um, what? There is nothing wrong with consecutive if statements if the situation calls for it.
|
I believe I clarified that with consecutive nested if statements.
Quote:
Originally Posted by Kristi
Your case is still wrong (as PFA already pointed out). You don't need an else to justify nested if statements. You should nest if statements if they don't follow the same logical flow. It makes no difference to the compiler so why not make it more readable?
|
I already said that was implied. Separating unrelated conditions is not something I think about because I just do it naturally.