Assignment Three Java Code