Answer:
Explanation:
The following code is written in Java and loops through 10 times. Each time generating 2 random dice rolls. If the sum is 10 it breaks the loop and outputs a "You Win" statement. Otherwise, it outputs "You Lose"
import java.util.Random;
class Brainly {
public static void main(String[] args) {
UseRandom useRandom = new UseRandom();
boolean youWin = false;
for (int x = 0; x<10; x++) {
int num1 = useRandom.getRandom(6);
int num2 = useRandom.getRandom(6);
if ((num1 + num2) == 10) {
System.out.println("Number 1: " + num1);
System.out.println("Number 2: " + num2);
System.out.println("You Win");
youWin = true;
break;
}
}
if (youWin == false) {
System.out.println("You Lose");
}
}
}
class UseRandom{
public int getRandom(int n)
{
Random r=new Random();
int rand=r.nextInt(n);
return rand;
}}
Answer:
I think he may be a nut, but I'm not sure, there's little evidence of what he says to be true.
Answer:
The output is 35
Explanation:
Required
Determine the output on line 5
We start by analysing the program line by line.
On line 1: kit = 20
On line 2: roo = 10
On line 3: kit = kit + 5
Substitute 20 for kit.
So, we have
kit = 20 + 5
kit = 25
On line 4:
roo = kit + roo
Substitute values for kit and too
roo = 25 + 10
roo = 35
On line 5: Output roo
So, 35 is displayed as an output
Answer:
Screen flickering is usually caused by an incompatible app or display driver. It could also be caused by a bad HDMI/VGA connection to the monitor.
Hope it helps ! :)