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

 

getNumForString


If the input string is "one" return the integer 1, "two" return 2, "three" return 3, for all other numbers return -1.


getNumForString("one") → 1
getNumForString("fourtytwo") → -1
getNumForString("two") → 2

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

public int getNumForString(String str) { }

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: 100

Copyright Nick Parlante 2017 - privacy