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

 

norm.krumpe@muohio.edu methodslab1 > diceMoney
prev  |  next  |  chance

In a game, you roll two dice, each numbered 1 through 6. If the two numbers are equal, you win 100 dollars, except if both dice are sixes, in which case you win 0 dollars. Otherwise, you win whatever the total was of the two dice. Write a method that returns your winnings for the given dice rolls.


diceMoney(4, 4) → 100
diceMoney(6, 6) → 0
diceMoney(3, 5) → 8

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

int diceMoney(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

Difficulty: 100

Copyright Nick Parlante 2017 - privacy