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

 

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

Write a method that returns a string constructed from two characters. The first character (a) will appear totA number of times. The second character (b) will appear after every freqB occurrences of the first character, except that this character will never appear at the very end of the string. Look at the test data for examples. You may NOT use ANY string methods! (None are needed). Obviously you will need to work with strings, but you cannot use any string METHODS such as .length, .substring, etc.


dec1_2017_SLHL_makeStr("1", "v", 3, 7) → "111"
dec1_2017_SLHL_makeStr("m", "z", 1, 4) → "m"
dec1_2017_SLHL_makeStr("j", "T", 0, 1) → ""

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

public String dec1_2017_SLHL_makeStr(char a, char b, int totA, int freqB) { }

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