id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

amjadm@miamioh.edu > lessPennies
prev  |  next  |  chance

Return the least number of pennies that we can carry around for having n dollars. For instance: if n = 10.11$, we can carry 11 cents as two nickels and a penny, so the minimum number of pennies would be 1.


lessPennies(1.01) → 1
lessPennies(200.0) → 0
lessPennies(0.0) → 0

...Save, Compile, Run (ctrl-enter)

public int lessPennies(double n) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 160

Copyright Nick Parlante 2017 - privacy