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:
Check the explanation
Explanation:
to know the lift per unit span (N/m) that is expected to be measured when the wing attack angle is 4°
as well as the corresponding section lift coefficient and die moment coefficient .
Kindly check the attached image below to see the step by step explanation to the above question.
Answer:
Explanation:
volume of 20.9 N
= 20.9 / 11.5 m³
= 1.8174 m³
In one hour 1.8174 m³ flows
in one second volume flowing = 1.8174 / 60 x 60
= 5 x 10⁻⁴ m³
Rate of volume flow = 5 x 10⁻⁴ m³ / s .
Answer:
Increases
Explanation:
By inhibiting the motion of dislocations by impurities in a solid solutions, is a strengthening mechanism. In solid solutions it is atomic level strengthening resulting from resistance to dislocation motion. Hence, the strength of the alloys can differ with respect to the precipitate's property. Example, the precipitate is stronger (ability to an obstacle to the dislocation motion) than the matrix and it shows an improvement of strength.
Answer:
B) An increase in pressure can lower the boiling point of a liquid and change the temperature at which it turns to a gas.
Explanation:
B) An increase in pressure can lower the boiling point of a liquid and change the temperature at which it turns to a gas.