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

 

tmhscs@gmail.com fundamentals > fund_diceGame
prev  |  next  |  chance

There is a dice game called "Craps" where you roll two dice. If your dice sum together to a 7 or an 11 you win. If you roll a 2, 3, or 12, then you lose. If you get any other number, then you must roll again. Return the String "win", "lose", or "reroll" based on the sum of the given two integers indicating the dice rolls.


fund_diceGame(1, 2) → "lose"
fund_diceGame(3, 4) → "win"
fund_diceGame(5, 6) → "win"

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

public String fund_diceGame(int die1, int die2) { }

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

Post-solution available

Copyright Nick Parlante 2017 - privacy