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

 

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

Write a method that accepts three integers: first, max, and step such that 0<first<=max and step>0. Return a string that contains integers separated by a comma and space starting at first and going up to and possible including max. The difference between consecutive integers will be step. Note that there is no comma or space after the last number. Introductory programming students can use a loop to solve this problem. Advanced students may FIRST solve it with a loop, but ultimately you must replace that with a recursive solution.


countUpBy(15, 30, 5) → "15, 20, 25, 30"
countUpBy(8, 15, 2) → "8, 10, 12, 14"
countUpBy(7, 17, 3) → "7, 10, 13, 16"

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

public String countUpBy(int first, int max, int step) { }

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

Copyright Nick Parlante 2017 - privacy