Skip to main content

Practice · 3 of 4

How many items can I buy?

CHALLENGE
Difficulty: beginner+25 XP

Implement int howManyItems(double money): the largest number of $2.50 items you can afford with money dollars. One expression is enough — think int division after a cast.

Back to lesson: Practice: Typed storage