Answer:
The solution code is written in Java.
- public class Main {
-
- public static void main(String[] args) {
-
- Scanner inNum = new Scanner(System.in);
- System.out.print("Enter number of toss: ");
- int num = inNum.nextInt();
-
- for(int i=0; i < num; i++){
- System.out.println(toss());
- }
- }
-
- public static String toss(){
- String option[] = {"heads", "tails"};
- Random rand = new Random();
- return option[rand.nextInt(2)];
- }
- }
Explanation:
Firstly, we create a function <em>toss()</em> with no parameter but will return a string (Line 14). Within the function body, create an option array with two elements, "heads" and "tails" (Line 15). Next create a Random object (Line 16) and use <em>nextInt()</em> method to get random value either 0 or 1. Please note we need to pass the value of 2 into <em>nextInx() </em>method to ensure the random value generated is either 0 or 1. We use this generate random value as an index of <em>option </em>array and return either "heads" or "tails" as output (Line 17).
In the main program, we create Scanner object and use it to prompt user to input an number for how many times to toss the coin (Line 6 - 7). Next, we use the input num to control how many times a for loop should run (Line 9). In each round of the loop, call the function <em>toss() </em>and print the output to terminal (Line 10).
Intranet is a network that is internal and use internet technologies. It makes information of any company accessible to its employees and hence facilitates collaboration. Same methods can be used to get information, use resources, and update the data as that of the internet.
Hopefully this helped.
Answer:
B. A software development firm needs someone to find and fix bugs on multiple computer platforms.
Explanation:
A software quality assurance engineer is someone who monitors every phase of the software development process so as to ensure design quality, making sure that the software adheres to the standards set by the development company. Finding bugs would make this intern a amazing bug finder
A formal indication from a state, on letterhead, or an official state form, which shows that an applicant has valid driving privileges and is clear to apply for a Colorado driver's license is called a clearance.
<h3>What is a learner's license?</h3>
A learner's license is also referred to as learner's permit and it can be defined as a category of driver's license that is issued to an individual who is learning how to drive an automobile vehicle (car).
<h3>What is a license?</h3>
A license is also referred to as a certificate and it can be defined as an authorization that is typically issued by state governments to a driver, so as to avail him or her the legal ability to physically driver in all the states across a country.
In this scenario, we can infer and logically deduce that a clearance is a formal indication from a state which shows and affirms that an applicant has valid driving privileges, and is permitted to apply for a Colorado driver's license.
Learn more about learner's license here: brainly.com/question/26289148
#SPJ1