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

 

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

Write a method that creates a new string given two strings 'str1' and 'str2' and an amount to jump by called 'jmp'. Create the new string by jumping through the other two strings and using characters from the strings to building the new string. Always pull from 'str1' first then 'str2'. Stop when either string runs out of characters. For example, if 'str1'="abcdefghij" and 'str2'="12345" and 'jmp'=2 you would return "a1c3e5". Make sure you understand why this would be the result. As a precondition, you may assume that 'jmp'>0.


quiz2022_03_09_APSLHL_mixStrings("A", "Z", 43) → "AZ"
quiz2022_03_09_APSLHL_mixStrings("Tigger", "Piglet", 3) → "TPgl"
quiz2022_03_09_APSLHL_mixStrings("bubblegum", "monkey", 2) → "bmbnle"

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

public String quiz2022_03_09_APSLHL_mixStrings(String str1, String str2, int jmp) { }

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

Copyright Nick Parlante 2017 - privacy