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

 

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

Write a method that returns the input parameter string with the even positioned characters in the same place (with the first character in position zero, which is even), and the odd positioned characters in reverse order. For example, the input string "AbCdEfG" becomes "AfCdEbG". In this case, I used capital letters at each of the even positions and lower-case letters at each of the odd positions to make it clearer. Note that the even positioned letters are in the original order and in the original position, but the odd positioned letters are in revers order. Look at the test data for further examples.


mar7_2016_APSLHL_partialReverse("this_is_a_test") → "ttie__s_aitssh"
mar7_2016_APSLHL_partialReverse("") → ""
mar7_2016_APSLHL_partialReverse("make_this_program_awesome") → "mmks_wh_sapgorr_miateeoae"

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

public String mar7_2016_APSLHL_partialReverse(String str) { }

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

Copyright Nick Parlante 2017 - privacy