about | help | code help+videos | done | prefs |
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) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 220
Copyright Nick Parlante 2017 - privacy