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:
Time taken = 136.32 minutes
Explanation:
The solution and complete explanation for the above question and mentioned conditions is given below in the attached document.i hope my explanation will help you in understanding this particular question.
Answer:
baking soda and vinegar dish soap
Explanation:
it will create a bubbles and let it sit for 3 hours and it will go away
5x-30=2
5x=2+30 (not -28) when the -30 is brought over to the RHS, 30 should be added to 2 instead of subtracted
hence, 5x=32
x = 6.4
Answer:
26.7 min
Explanation:
First, we will find the <u>time required to drill each hole</u>:
- N = 300 x 12/0.75 = 1527.7 rev/min
- fr = 1527.7 (0.015) = 22.916 in/min
Formula for <u>distance per hole</u>: 0.5 + A + 1.75
- A = 0.5 (0.75) tan (90-100 / 2) = 0.315 in
- Tm = (0.5 + 0.315 + 1.75) / 22.916 = 0.112 min
Now, we will calculate the <u>time required to draw back the drill form hole</u>:
= 0.112 / 2 = 0.056 min
Time to move between holes = 1.5 / 15 = 0.1 min
For 100 holes, the number of moves between holes = 99
Total time required to drill 100 holes (t):
t = 100 (0.112 + 0.056) + 99 (0.1) = 26.7 min