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

 

abraskin@mbusd.org 2016_student_creations_01 > reverseAndExtend
prev  |  next  |  chance

Write a method that takes the String given and makes it half the length. Once you did that take it and reverse the order. Then take the last letter and repeat it the amount of times given (the int)


reverseAndExtend("help", 2) → "plehh"
reverseAndExtend("and there he is", 5) → "si eh ereht dnaaaaa"
reverseAndExtend("wowie", 34) → "eiwowwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww"

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

String reverseAndExtend(String str, int a) }

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: 100 Post-solution available

Copyright Nick Parlante 2017 - privacy