Is this a classroom assignment ? IF so, this sites policy is to NOT give solutions, just advice..., but if you understand both the proffered solutions, neither is hard to change int an if statement...