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_APSLHL_fract
prev  |  next  |  chance

Write a method that returns a string representing the fraction with a numerator of 'numerator' and a denominator of 'denominator', except if 'denominator' is zero then you return "Not a number (NaN)" because you cannot divide by zero so a fraction with a zero in the denominator doesn't make sense!


test2021_11_18_APSLHL_fract(51, 11) → "51/11"
test2021_11_18_APSLHL_fract(5, 3) → "5/3"
test2021_11_18_APSLHL_fract(6, 2) → "6/2"

...Save, Compile, Run (ctrl-enter)

public String test2021_11_18_APSLHL_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: 220

Copyright Nick Parlante 2017 - privacy