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

 

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

When a Balrog is hungry, his stomach growls. How loudly it growls depends upon his hunger number and his food number. The loudness of his growl will be at least 2 and will be the lowest number that you can mod both number by to get the same result. For example, if hunger is 86 and food is 46, the growl number will be 2 since 86 mod 2 = 46 mod 2. However, for 25 and 18, the growl number is 7 because 7 is the lowest number that mods both 25 and 18 to get the same result.


balrogBones(86, 46) → "Growl loudness = 2"
balrogBones(25, 18) → "Growl loudness = 7"
balrogBones(142, 45) → "Growl loudness = 97"

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

public String balrogBones(int hunger, int food) { }

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

Copyright Nick Parlante 2017 - privacy