1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
PolarNik [594]
3 years ago
6

In the simulation, player 2 will always play according to the same strategy. The number of coins player 2 spends is based on wha

t round it is, as described below. (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.
Computers and Technology
1 answer:
baherus [9]3 years ago
8 0

The simulation, player 2 will always play according to the same strategy.

Method getPlayer2Move below is completed by assigning the correct value to result to be returned.

Explanation:

  • 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.

#include <bits/stdc++.h>  

using namespace std;

bool getplayer2move(int x, int y, int n)  

{

   int dp[n + 1];  

   dp[0] = false;  

   dp[1] = true;  

   for (int i = 2; i <= n; i++) {  

       if (i - 1 >= 0 and !dp[i - 1])  

           dp[i] = true;  

       else if (i - x >= 0 and !dp[i - x])  

           dp[i] = true;  

       else if (i - y >= 0 and !dp[i - y])  

           dp[i] = true;  

       else

           dp[i] = false;  

   }  

   return dp[n];  

}  

int main()  

{  

   int x = 3, y = 4, n = 5;  

   if (findWinner(x, y, n))  

       cout << 'A';  

   else

       cout << 'B';  

   return 0;  

}

You might be interested in
1. How has ESPN handled the rise of Twitter? How has it incorporated Twitter into Sports Center?
vovangra [49]

<u>Rise of Twitter:</u>

On every sport telecast ESPN create a twitter accountants raise a sport questions related to sport telecasted. Base of sport interested person answer queries or questions so automatically incorporated to sport center

<u>Cable subscriptions:</u>

Since ESPN been telecasted through air with customer login with minimum subscription fees so end user easily login n watch the match online and live telecast. Moreover end user can watch old or missed match from archive library on its own time.

ESPN is subscription channel are also available as bundle option in hot star amazon prime video.

<u>ESPN upgrade</u>:

ESPN telecast match on season basic such as football, cricket extra. ESPN very frequently upgrade the match schedule and old archives. Sports person interviews n performance of software also is upgraded to end users.

4 0
3 years ago
Read 2 more answers
Is Flip book drawings, frame by frame (need great drawing skills).
lyudmila [28]
I would say traditional animation
7 0
3 years ago
1. Describe how research and development influence design. Cite specific examples of how research and development influence desi
vladimir1956 [14]

Answer:

so i research and found this,

Development is when findings of a research are utilized for the production of specific products including materials, systems and methods. Design and development of prototypes and processes are also part of this area. Engineering is utilization of these plans and research to produce commercial products.

4 0
2 years ago
research about the various models of intel processors from the last decade focusing on their speed and cost​
Likurg_2 [28]

The Intel announced the eighth- generation chips will offer up to 40 percent speed boost  over the previous generation.

Explanation:

The most popular Intel processors are the core i3, i5, and i7 product lines. The core i3 is entry level and core i7 processors are the powerful hyper-threaded quad-core options.

The CPU does good job in understanding and completing single tasks. A clock speed of 3.5 GHz to 4.0 GHz is considered a good clock speeding for gaming. It is useful for having good single thread performance.

Intel's prior series of 8086,80186, 80386 and 80486 microprocessors, the first P5 based microprocessor released as original Intel Pentium.

8 0
3 years ago
In the excerpt above, what can be inferred by the statement, “The Dillingham had been flung to the breeze during a former period
galina1969 [7]
The best and the most correct answer among the choices provided by the question is the first choice. We can infer from the excerpt that <span>Jim felt important enough to place his full name on the mailbox when he enjoyed a higher income. </span>I hope my answer has come to your help. God bless and have a nice day ahead!
3 0
2 years ago
Read 2 more answers
Other questions:
  • You know a Linux command will perform a desired function for you, but you cannot remember the full name of the command. You do r
    14·1 answer
  • Which is an internet service?<br><br> Antivirus<br> Chat<br> Firewall<br> Router
    8·2 answers
  • Describe safe motherhood​
    9·2 answers
  • One of your professors has asked you to write a program to grade her midterm exams, which consist of only 20 multiple-choice que
    15·1 answer
  • Write a Java program to count the characters in each word in a given sentence?Examples:Input : geeks for geeksOutput :geeks-&gt;
    10·1 answer
  • Explain each kind of pointer and for what it is appropriate
    15·2 answers
  • What is the function of a breadcrumb trail in a website?
    13·1 answer
  • Why is drive of value when pursuing a career in IT?
    14·1 answer
  • A Development team begins work on a new software application and decides to involve the client’s IT experts to ensure that secur
    12·1 answer
  • What is a guardian node summary for theta staking tool
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!