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;
}
Answer:
Explanation:
Duplicate tuples are not allowed in a relation because the specifications of the constraints of the regional integrity are violated, especially the main constraint that states that there can be no identical values for the attributes of two tuples at any database relation state.
Also, duplicate tuples are not allowed in a relation due to the fact that they lead to redundancy of the data base which in turn, slowing down the speed of the database when data processing such as inserting, querying, updating, deleting, etc are being performed.
Specification of database requirements falls under which category of database administration?
b. development
Answer:
Pen Drive offers more accessibility
Not every device is equipped with a CD player but every device has a USB port for a pen Drive. Saving on the pen Drive will therefore enable the data to be more accessible.
Pen Drive has more space.
CDs usually have a storage capacity of below a gigabyte whilst pen drives can reach up to 2 terabytes thereby offering exponentially more space to save data.
Safety of Data
CDs are more prone to damage as data could be lost if the CD is scratches. Pen Drives on the other hand are encased in an outer case that protects the data.
Answer: Control
Explanation: Communication channel is the medium created for the process of the communication.These channel let the source to destination communication in a cycle so that message can be send and received respectively.
Control in the branch of communication channel is used for the handling of the communication limit of the message that is being sent and received .It puts a limitation to the extent message can be read, recorded ,movement of resource and other facilities.