about | help | code help+videos | done | prefs |
Write the method that receives a decimal number (between 0 and 1) and returns an array where in subscript zero is the numerator and subscript one is the denominator. Place the numerator into the zero subscript and the denominator into the first subscript location of the answer. EXAMPLES: .5 -> [1,2] and .05 ->[1,20] and .125 -> [1,8] decimalToFraction(0.5) → [1, 2] decimalToFraction(0.05) → [1, 20] decimalToFraction(0.123) → [123, 1000] ...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: 170 Post-solution available
Copyright Nick Parlante 2017 - privacy