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

 

sspiege3@schools.nyc.gov > getWordSoFar
prev  |  next  |  chance

getWordSoFar:
Given two parallel Arraylists of the same size, one of letters and one of Booleans, this method will return a String that for each position has a corresponding letter for letters if there is a true in the correct Arraylist or a "?" is there is a false in the position of correct You will need to concatenate/build the String via a loop. example:

        String res = "";
        
        for(int i=0; i<5; ++i){
            res += "2";
        }
At the end of this loop res equals "22222"

getWordSoFar(["A", "N", "G", "R", "Y"], [true, true, false, false, false]) → "AN???"
getWordSoFar(["A", "N", "G", "R", "Y"], [false, true, false, false, false]) → "?N???"
getWordSoFar(["A", "N", "G", "R", "Y"], [true, false, true, false, false]) → "A?G??"

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

public String getWordSoFar( List<String> letters, List<Boolean> correct){ }

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

Copyright Nick Parlante 2017 - privacy