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

 

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

For this problem, do not use any string methods. You must solve the problem only using string assignment statements and/or concatenation. Write a method that returns a string that has 'repeat' copies of numbers that count by 1 from 'low' to 'high'. You must use the exact formatting shown, with spaces between numbers and symbols as shown, but with no space at the end of the string. You cannot put that extra space at the end and then remove it with substring because no string methods are allowed! Look carefully at the test data to make sure you understand your goal. Also note that when 'repeat' is 1, there will be no ":" separating the repeating counts because there will be only one count. Also, repeat>=1 in all cases and low<=high in all cases.


ccc1FunnyNums(4, 6, 2) → "4 5 6 : 4 5 6"
ccc1FunnyNums(1, 5, 1) → "1 2 3 4 5"
ccc1FunnyNums(-5, -3, 3) → "-5 -4 -3 : -5 -4 -3 : -5 -4 -3"

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

public String ccc1FunnyNums(int low, int high, int repeat) { }

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

Copyright Nick Parlante 2017 - privacy