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

 

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

Write a method that accepts a string 'str' and an integer 'copies' parameter. Use that string to construct a new string with 'copies' number of occurances of each character from the original 'str' string. For example, using "ace" for the string and 3 for 'copies' you would return "aaaccceee". For additional examples, look at the test data. Recursion is NOT required for this problem.


vpeepsMakeString("Jump", 5) → "JJJJJuuuuummmmmppppp"
vpeepsMakeString("xj97", 2) → "xxjj9977"
vpeepsMakeString("", 5) → ""

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

public String vpeepsMakeString(String str, int copies) { }

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