about | help | code help+videos | done | prefs |
Write a method that accepts a positive integer input parameter. Return a new integer that has had each of its digits modified in the following way: For digits 1 through 8, simply increase the digit by 1. For the digit 9, replace it with a 1. For the digit 0, leave it unchanged, unless it is not a significant digit (zeros at the RIGHT end of the number are not significant digits), in which case you omit the 0. You may NOT use any strings in solving this problem. Div and Mod are definitely the way to go here! Recursion is optional. preEaglesDigitIncreaseAdvanced1(10) → 2 preEaglesDigitIncreaseAdvanced1(98765) → 19876 preEaglesDigitIncreaseAdvanced1(421453) → 532564 ...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: 290
Copyright Nick Parlante 2017 - privacy