Answer:
Explanation:
import java.util.Scanner;
public class KboatTriangleAngle
{
public static void main(String args[]) {
Scanner in = new Scanner(System.in);
System.out.print("Enter first angle: ");
int a1 = in.nextInt();
System.out.print("Enter second angle: ");
int a2 = in.nextInt();
System.out.print("Enter third angle: ");
int a3 = in.nextInt();
int angleSum = a1 + a2 + a3;
if (angleSum == 180 && a1 > 0 && a2 > 0 && a3 > 0) {
if (a1 < 90 && a2 < 90 && a3 < 90) {
System.out.println("Acute-angled Triangle");
}
else if (a1 == 90 || a2 == 90 || a3 == 90) {
System.out.println("Right-angled Triangle");
}
else {
System.out.println("Obtuse-angled Triangle");
}
}
else {
System.out.println("Triangle not possible");
}
}
}
OUTPUT:
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:
(a)Applications Time Stamp Events
(b)S=0.5(W-
)+
, where
≤W≤
+8.
Explanation:
Some applications assume that clocks always advance, so they could timestamp events under this assumption.
In our case we have the wrong timed clock, say W and the hardware clock H which is supposed to advance at a perfect rate.
We proceed to construct a software clock such that after 8 seconds we can replace the wrong timed clock with the software clock in good conditions.
Let us denote the software clock with S.
Then, S=c(W-
)+
where:
=The current Time(10:27:54) and;
c is to be found.
We already know that S=
+4 when W=
+8,
So:
S=c(W-
)+
+4=c(
+8-
)+
4=8c
c=0.5
We obtain the formula
S=0.5(W-
)+
, where
≤W≤
+8.
we translate the following statement given in terms of logarithms. 211 base x can be expressed into log 211 / log x while 152 base 8 can be expressed int o log 152 over log 8. In this case,
log 211 / log x = log 152 / log 8log x = 0.962x = 10^0.962 = 9.1632
Answer:
Option d is the correct answer for the above question.
Explanation:
- Authentication is a process that enables the user to enter the system. This process helps to secure the data. It is because with the help of this only valid users can enter the system. In this process, the system asks some unique information from the user which can only be known to the valid user.
- Some systems put two types of authentications one is some information about the valid user and the other is a fingerprint scan that takes the data of the user finger and matches with their user name and password. If it matches then only he can enter into the system.
- The above question asks about the mechanism which is used for multifactor authentication. This authentication is known as a fingerprint scan. So the option D is the correct answer while the other is not because:-
- Option 'a' states about the username which is used in the first authentication.
- Option b states about pin which can be used in the place of username.
- Option c states about the security question which is used when the user forgets the password.