Simplify #6 solution to avoid using a ternary operator.
Ex 07.