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

1 Expert Approved Answer
Step: 1 Unlock

public static ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Building Java Programs A Back to Basics Approach Questions!