Write a method called countQuarters that takes an int representing a number of cents as a parameter

Question:

Write a method called countQuarters that takes an int representing a number of cents as a parameter and returns the number of quarter coins represented by that many cents. Don’t count any whole dollars, because those would be dispensed as dollar bills. For example, countQuarters(64) would return 2, because 64 cents is equivalent to 2 quarters with 14 cents left over. A call of countQuarters(1278) would return 3, because after the 12 dollars are taken out, 3 quarters remain in the 78 cents that are left.

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

Step by Step Answer:

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