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
GenXTech is a growing company that develops gaming applications for military simulations and commercial clients. As part of its
rodikova [14]

Answer:

enterprise architecture

Explanation:

Based on the information provided within the question it can be said that in this scenario GenXTech seems to be creating an enterprise architecture. This is a blueprint that completely detail the structure and different operations within an organization, with the main focus of how the organization can best achieve it's objective. Which is what GenXTech is trying to do by analyzing it's situation.

4 0
2 years ago
Fred opens a web browser and connects to the www.certskills.com website. Which of the following are typically true about what ha
Masja [62]

Answer:

c. Messages flowing to the client typically use a source TCP port number of 80.

d. Messages flowing to the server typically use TCP.

Explanation:

When fred open the web browser and start a connection to the www.certskills.com website.Two things happens from the mentioned things

1.Messages that are going to the server are use TCP(Transmission Control Protocol).

2.Message goes to the client uses port number 80 that is of TCP used for transferring web pages.

Because the port number 80 is reserved for the HTTP used for transferring web pages that uses TCP protocol.

4 0
3 years ago
How can you achieve an effect like that shown in the image
Naily [24]
You can go into your bedroom on a dark night, then close your eyes, and press your face into the pillow. You will then see an exact copy of the image, in perfect detail.
8 0
2 years ago
Read 2 more answers
A company has two geographically separate locations that need to connect using a VPN. Which of the following devices must be spe
victus00 [196]

Answer:

The correct answer to the following question will be Option A (Firewall).

Explanation:

  • A network or information system of safety that relies on predetermined security rules that monitors and commands outbound traffic of network or it will be configured specifically to allow VPN to enter the network
  • This usually creates a firewall between a trustworthy internal network, such as the Internet, and the untrustworthy outside network.

The other solutions like B, C and D are not capable of allowing VPN to traffic to a network. Therefore, the correct answer is Option A.

3 0
3 years ago
Which file format produces a lock-down version of an access database? accdb accdb-be accde accdb-e
jek_recluse [69]

The file format that produces a lock-down version of an access database is called; ACCDE

<h3>How to Identify Access Database?</h3>

ACCDB files are the default Microsoft Access database format in Access 2007 and later versions while the ACCDE format is a read-only, compressed version.

Now, the file format that produces a lock down version of an access database is called ACCDE file which is a Microsoft Access Execute Only Database file used to protect an ACCDB file.

Read more about Access Database at; brainly.com/question/9745438

#SPJ1

8 0
1 year ago
Other questions:
  • Jana keeps receiving friend requests from strangers on a social media site. This is making her uncomfortable.
    15·2 answers
  • Which of the following should be considered when conducting an audience analysis ?
    13·2 answers
  • Traffic collisions are among the top killers of children in America.
    13·1 answer
  • 1- How should an operating system support communication between applications? explain your reasoning?
    10·1 answer
  • What do you hope will be in/added GTA 6?
    13·1 answer
  • g How safe is to have a LinkedIn account where you have published all the important information about yourself
    13·2 answers
  • Which step in the software development life cycle analyzes the scope of work?
    6·1 answer
  • A (n) ___ system can help a business alleviate the need for multiple information systems.
    13·1 answer
  • If you want to share information with individuals who are internal to your organization, which type of network would you want to
    6·1 answer
  • If you try to add a new item to a full stack the resulting condition is called a(n)?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!