about | help | code help+videos | done | prefs |
Write a method that returns a string representing a reduced fraction given 'numerator' and 'denominator'. If the result has a denominator of 1 then you must return the answer as a whole number without showing the "/1" part. Look at the test data for examples. test2021_11_18_SLHL_fract(1, 171) → "1/171" test2021_11_18_SLHL_fract(1, 19) → "1/19" test2021_11_18_SLHL_fract(2, 80) → "1/40" ...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: 270
Copyright Nick Parlante 2017 - privacy