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

 

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

Write a method that accepts two integer parameters 'first' and 'last'. Build a string out of the numbers between 'first' and 'last' inclusive by counting from 'first' to 'last' then back down to 'first'. Each pair of numbers has exactly one space between them, with no other spaces in the string. In particular the string does not start or end with a space. Look at the test data for examples.


feb5_2016_SLHL_makeSymmetry(4, 6) → "4 5 6 5 4"
feb5_2016_SLHL_makeSymmetry(5, 5) → "5"
feb5_2016_SLHL_makeSymmetry(23, 7) → ""

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

public String feb5_2016_SLHL_makeSymmetry(int first, int last) { }

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