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:
Sensor/transducer: bimetallic thermometer
Output: displacement of thermometer tip
Control Tstages: mercury contact switch (open:furnace off; closed:furnace on
Explanation:
for a standard room thermostat
: This is the device that sets/determines the temperature of an enclosure.
Sensor/transducer: bimetallic thermometer: Bimetalic thermometer are used for measuring the temperature of the ambient air
. bimetallic thermometer actually contains two metals. they undergo linear expansivity as the temperature of the room changes.in other words, they experience contraction and expansion with increase or decrease in temperature.The sensor is basically coupled with a transducer which turns the measured variable(Temperature) into something else, such as a movement on a dial or an electrical signal
Output: displacement of thermometer tip
Controller: mercury contact switch (open:furnace off; closed:furnace on)
once the contact switch is open the furnace can go off. when the contact switch is closed, the furnace will come up.
Answer:
Those products are generally called Work in Process WIP
Explanation:
Work in process (WIP), or work in progress (WIP), goods in process, or in-process inventory in a manufacturing industry/company refer to the company's partially finished goods waiting for completion and eventual sale or the value of these items.
These items are either just being produced or require further processing (like purification, separation, packaging or handling) in a queue or a buffer storage.