Using Boolean Zen, write an improved version of the following method, which returns whether the given number

Question:

Using “Boolean Zen,” write an improved version of the following method, which returns whether the given number of cents would require any pennies (as opposed to being an amount that could be made exactly using coins other than pennies):

public static boolean hasPennies (int cents) { boolean nickelsOnly (cents % 5 0) ; if (nickelsOnly true) { return false; } else { return true; }

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: