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).
Answer:
True
Explanation:
Mass burn technology is a type of waste-to-energy technology commonly used in the mass-burn system, where unprocessed municipal solid waste is burned in a large incinerator with a boiler, to generate heat used in the production of electricity.
Answer:
pliers
Explanation:
because that makes the most sense
Answer:
The given blanks can be filled as given below
Voltmeter must be connected in parallel
Explanation:
A voltmeter is connected in parallel to measure the voltage drop across a resistor this is because in parallel connection, current is divided in each parallel branch and voltage remains same in parallel connections.
Therefore, in order to measure the same voltage across the voltmeter as that of the voltage drop across resistor, voltmeter must be connected in parallel.
Answer:
Option D
Explanation:
A post development hydrograph will have lower concentration time and lower infiltration losses and hence sooner peak and higher peak and more runoff or higher area under graph. Therefore, all the answers are correct hence option D