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

 

stringToPennies


Given a String s that contains a dollar amount below $1,000, including the dollar sign ($), return the number of pennies needed to make up that value.


stringToPennies("$5.95") → 595
stringToPennies("$0.32") → 32
stringToPennies("$99.00") → 9900

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

public int stringToPennies(String s) { }

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: 9 Post-solution available

Copyright Nick Parlante 2017 - privacy