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
given,
6 lanes divided highway 3 lanes in each direction
rolling terrain
lane width = 10'
shoulder on right = 5'
PHF = 0.9
shoulder on the left direction = 3'
peak hour volume = 3500 veh/hr
large truck = 7 %
tractor trailer = 3 %
speed = 55 mi/h
LOS is determined based on V p
10' lane weight ; f_{Lw}=6.6 mi/h
5' on right ; f_{Lc} = 0.4 mi/hr
3' on left ; no adjustment
3 lanes in each direction f n = 3 mi/h



= 0.877

= 1,555 veh/hr/lane

= (55 + 5) - 6.6 - 0.4 -3 -0
= 50 mi/h


level of service is D using speed flow curves and LOS for basic free moving of vehicle
Row choice the cost of roadway improvements to the developer and functional the amount of trafficBeing generated by the theater as well as the Ralph’s ladies