/** * threeOfAKind method * this method will determine if all three of the dice * have the same value * @return true if they have the same value, false otherwise */
Write the method that matches this comment.
C++ code for threeOfAKind method:
int threeOfAKind(int a,int b,int c)
{
if(a==b&&b==c)
return true;
return false
}
Java non static method code:
public int threeOfAKind(int a,int b,int c)
{
if(a==b&&b==c)
return true;
return false
}
Java static method code:
public static int threeOfAKind(int a,int b,int c)
{
if(a==b&&b==c)
return true;
return false
}
Get Answers For Free
Most questions answered within 1 hours.