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

 

jebbert@volusia.k12.fl.us > sep9_2016_SLHL_copyChars
prev  |  next  |  chance

Write a method that accepts a non-negative integer length called 'howMany' and two characters. Return a string array with howMany copies of the first character followed by howMany copies of the second character. Look at the test data for examples.


sep9_2016_SLHL_copyChars(3, "a", "b") → ["a", "a", "a", "b", "b", "b"]
sep9_2016_SLHL_copyChars(1, "6", "q") → ["6", "q"]
sep9_2016_SLHL_copyChars(2, "h", "w") → ["h", "h", "w", "w"]

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

public String[] sep9_2016_SLHL_copyChars(int howMany, char ltr1, char ltr2) { }

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

Copyright Nick Parlante 2017 - privacy