Answer:
Explanation:
The following code is written in Java. It creates a loop within a loop that plays the game 10 times. As soon as the inner loop tosses a Heads (represented by 1) the inner loop breaks and the cost of that game is printed to the screen. A test case has been made and the output is shown in the attached image below.
import java.util.Random;
import java.util.Scanner;
class Brainly {
public static void main(String[] args) {
int count = 0;
int loopCount = 0;
while (loopCount < 10) {
while (true) {
Random rand = new Random();
int coinFlip = rand.nextInt(2);
count++;
if (coinFlip == 1) {
System.out.println("Cost: $" + 2*count);
count = 0;
break;
}
loopCount++;
}
}
}
}
Swimming questions that you need to know how to do
Answer: Star topology is commonly used these days.
Explanation:
- As, start topology is the reliable network topology because the failure of a central node or a node cable does not affect the remaining other nodes.
- In star topology, if the computer fails you can still access your data by using backup folder in your private file or folder.
- In this network topology it is easy to find faults and correct it timely.
- The start topology is cost effective and easy to maintain.
- We can also connect multiple communication channels.
Answer:
By simply retweeting
Explanation:
A tweet from someone you follow or from someone else that you do not follow that is shared publicly with your followers is called a Retweet. The Retweet button on twitter helps you pass along news to everyone. This button comes with an option to add your own comment before retweeting or retweet the tweet as it is.
Answer:
Transition effect
Explanation:
When creating a presentation using PowerPoint, to add a visual effect when moving from one slide to another, you'll need to add Transition effects.
A transition effect is an animation that determines how a presentation slide will move to the next slide. This effect could either be Fade, Warp, etc.