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

 

andersoniii.edwin@cusd80.com > wheelOfFortune
prev  |  next  |  chance

Write the method called “wheelOfFortune”. This method receives a string and returns a String with given letters is displayed and all other characters have been replaced with a hyphen. Given: I Love Java this would return i -o-e -a-a DO NOT USE THE UNDERSCORE. We will assume the words are separated by just one space. No beginning space, BUT there will always be an ending space character. Ignore case - change every phrase to lower case. Extra challenge: Use a boolean "helper" method to test "WOF" letters. (ie: r, s, t, l, n, e)


wheelOfFortune("Finding a Road Map") → "--n--n- - r--- ---"
wheelOfFortune("Math Is For Champions") → "--t- -s --r -------ns"
wheelOfFortune("Convert to feet") → "--n-ert t- -eet"

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

public String wheelOfFortune( String phrase){ }

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