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

 

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

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)

public String test2021_11_18_SLHL_fract(int numerator, int denominator) { }

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

Copyright Nick Parlante 2017 - privacy