Java Program Using Nested Ifs