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:
Zero(0)
Explanation:
<u>Global Variables
</u>
Variables which are declared outside any function. Any function can use these variables,they are automatically initialized to zero(0).They are generally declared before main() function.
Example- C program for showing global variable is 0.
#include <stdio.h>
int g; // declaring g as global variable
int main()
{
printf("%d",g); //printing global variable
return 0;
}
<u>Output</u>
0
Answer:
To communicate effectively, you need to avoid distractions and stay focused. Inconsistent body language. Nonverbal communication should reinforce what is being said, not contradict it. If you say one thing, but your body language says something else, your listener will likely feel that you're being dishonest.
Web Note. You can access the feature by selecting "Make a web note" and several options on the toolbar will pop up for use. Microsoft has a help page here: https://support.microsoft.com/en-us/help/17221/windows-10-write-on-the-web