0

I am trying to create a method entitled rolledOneOnlyOnce that takes in two integers as parameters and returns a Boolean. This method must be public and static. In this method, the integer parameters represent the values currently on each of the Game’s die (die1,die2 respectively). Here, you will want to return true if only one of the die’s value is 1. Otherwise, return false.

For, A method entitled snakeEyes that takes in two integers as parameters and returns a Boolean. This method must be public and static. In this method, the integer parameters represent the values currently on each of the Game’s die (die1,die2 respectively). Here, you will want to return true if only both of the die’s values are 1. Otherwise, return false. **I wrote return (d1 ==1) && (d2==1); and IT WORKED!!! **

**But not sure about the first one. **

What code should I write?

3
Contributors
2
Replies
9
Views
1 Year
Discussion Span
Last Post by JamesCherrill
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.