Advanced Placement (AP)

(a) You will write method getPlayer2Move, which returns the number of coins that player 2 will spend in a given round of the game. In the first round of the game, the parameter round has the value 1, in the second round of the game, it has the value 2, and so on. The method returns 1, 2, or 3 based on the following rules. If round is divisible by 3, then return 3.
If round is not divisible by 3 but is divisible by 2, then return 2.
If round is not divisible by 3 and is not divisible by 2, then return 1.
Complete method getPlayer2Move below by assigning the correct value to result to be returned.

/** Returns the number of coins (1, 2, or 3) that player 2 will spend, as described in part (a).

*/

public int getPlayer2Move(int round)

{

int result;

return result;

}

answer
Answers: 2

Other questions on the subject: Advanced Placement (AP)

image
Advanced Placement (AP), 22.06.2019 06:10, daydallas01
Technician a says after tire service work tires and wheels must be in a state of static and dynamic balance in order to avoid vibration in service. technician b says tires and wheels are balanced at the factory and do not need further balancing. who is correct?
Answers: 1
image
Advanced Placement (AP), 23.06.2019 14:00, rendaescamilla
Which of the following statements is not true about regions? a.) regions have fixed boundaries that are determined by the region's inhabitants. b.) a region can be defined by physical characteristics, such as climate, landform, and vegetation. c.) regions can change over time. d.) a region can be defined by human characteristics, such as language, government, and economic activity. e.) the same location can be considered part of multiple regions.
Answers: 1
image
Advanced Placement (AP), 24.06.2019 16:00, heytherepeople101
The biome pictured above is found in areas such as kenya and south africa. the land is grass-covered with very few trees and gazelles and other grazers are common here. why does this biome have a low population of trees? a) large grazing animals destroy the trees. b) it is a deforested rainforest with poor soil. c) it has high temperatures and low precipitation. d) it has a long rainy season followed by flooding.
Answers: 1
image
Advanced Placement (AP), 24.06.2019 20:30, yorbal6109
Which presentation option is also known as a screen of a presentation?
Answers: 1
Do you know the correct answer?
(a) You will write method getPlayer2Move, which returns the number of coins that player 2 will spend...

Questions in other subjects:

Konu
Mathematics, 26.03.2020 00:05