about | help | code help+videos | done | prefs |
diceMoney
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) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 100
Copyright Nick Parlante 2017 - privacy