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
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.
Step by Step Solution
3.38 Rating (154 Votes )
There are 3 Steps involved in it
public static ... View full answer
Get step-by-step solutions from verified subject matter experts
