Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

//*** //*** Write a public static method named calculateUpperSectionCategory that //*** returns int and that receives an int parameter named dieNumber. //*** //*** Write the

//*** //*** Write a public static method named "calculateUpperSectionCategory" that //*** returns int and that receives an int parameter named "dieNumber". //*** //*** Write the method body code as follows: //*** 1) Declare an int variable named "score" and assign the value of zero to it. //*** 2) Write a println statement that displays the message "In method calculateUpperSectionCategory". //*** 3) Write a return statement that returns the variable "score". //***

//*** //*** Your method code goes here. //***

//*** //*** Write a public static method named "calculateThreeOfKind" that //*** returns int and receives no parameters. //*** //*** Write the method body code as follows: //*** 1) Declare an int variable named "score" and assign the value of zero to it. //*** 2) Declare a boolean variable named "isThreeKind" and assign the value of false to it. //*** 3) Write a println statement that displays the message "In method calculateThreeOfKind". //*** 4) Write a return statement that returns the variable "score".

//*** Write the method body code as follows: //*** 1) Declare a boolean variable named "gameOver" and assign the value of false to it. //*** 2) Write an if-statement that checks the following thirteen (13) variables for "equality to" SCORE_NO_VALUE. //*** Use the correct Java syntax for the "equality" operator. //*** Join the thirteen (13) conditions together using the "OR" operator. //*** Use the correct Java syntax for the "OR" operator. //*** 3) Write a statement that assigns the value of false to the variable "gameOver" if the condition //*** in step 2 evaluates to true //*** 4) Write an else-statement that is matched to the if-statement in step 2 that //*** assigns the value of true to the variable "gameOver" //*** 5) Write a return statement that returns the variable "gameOver".

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Illuminated

Authors: Catherine M. Ricardo, Susan D. Urban, Karen C. Davis

4th Edition

1284231585, 978-1284231588

More Books

Students also viewed these Databases questions