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

 

zbaharav@kehillah.org > logicStrings
prev  |  next  |  chance

Given an array of Strings, array of booleans, and array of integers, all of the same size, return an array of Strings with elements according to the following rules: If the corresponding element in the boolean array is false, the element you return is a string containing the number. If the corresponding element in the boolean is true, return the string augmented with the number. Please use only the 'official' AP String functions if needed. Hint: you do NOT need any.


logicStrings(["StringA"], [true], [1]) → ["StringA1"]
logicStrings(["StringA"], [false], [1]) → ["1"]
logicStrings(["A", "B", "C"], [false, true, true], [1, 2, 3]) → ["1", "B2", "C3"]

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

public String[] logicStrings(String[] sArray, boolean[] bArray, int[] iArray) { }

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

Copyright Nick Parlante 2017 - privacy