1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
zepelin [54]
3 years ago
15

Process synchronization can be done on

Engineering
1 answer:
marishachu [46]3 years ago
5 0

Answer:

it is c) both (a) and (b)

Explanation:

You might be interested in
java Write a program that simulates tossing a coin. Prompt the user for how many times to toss the coin. Code a method with no p
max2010maxim [7]

Answer:

The solution code is written in Java.

  1. public class Main {
  2.    public static void main(String[] args) {
  3.        Scanner inNum = new Scanner(System.in);
  4.        System.out.print("Enter number of toss: ");
  5.        int num = inNum.nextInt();
  6.        for(int i=0; i < num; i++){
  7.            System.out.println(toss());
  8.        }
  9.    }
  10.    public static String toss(){
  11.        String option[] = {"heads", "tails"};
  12.        Random rand = new Random();
  13.        return option[rand.nextInt(2)];
  14.    }
  15. }

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).  

4 0
4 years ago
Read 2 more answers
Write multiple if statements:
lora16 [44]
Zrizorzlzfxxxgoxxxxpgxtoxxxhxuxyf
3 0
3 years ago
Bore = 3"
Grace [21]
I need help my self lol XD
5 0
3 years ago
Read 2 more answers
La base de los tema relacionados a las ciencia de las ingeniería es?
Yanka [14]

Answer:

La ciencia y la ingeniería conciben el mundo como comprensible, con reglas que gobiernan su funcionamiento y que a través de un estudio cuidadoso y sistemático se puede evidenciar mediante patrones consistentes que permitan la oportunidad de examinar las características fundamentales que mejor describen los fenómenos.

Explanation:

5 0
3 years ago
What is the measurement of this dial caliper? <br> A. 5.491<br> B. 4.044<br> C. 5.691
just olya [345]
Its C .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........
4 0
4 years ago
Other questions:
  • A device is needed to accelerate a 3000 lb vehicle into a barrier with constant velocity to test its 5 mph bumpers. The vehicle
    12·2 answers
  • In what situation you would prefer to use a successive approximation ADC over flash ADC?
    13·1 answer
  • A fatigue test is performed on 69 rotating specimens made of 5160H steel. The measured number of cycles to failure (L in kcycles
    6·1 answer
  • The heat input to an Otto cycle is 1000kJ/kg. The compression ratio is 8 and the pressure and temperature at the beginning of th
    8·1 answer
  • After the load impedance has been transformed through the ideal transformer, its impedance is: + . Enter the real part in the fi
    8·1 answer
  • C programming fundamentals for everyone​
    13·1 answer
  • Which organisms are consumers in this food chain? List all that apply. *
    5·1 answer
  • Special certification is required for technicians who handle which of the following systems?
    10·1 answer
  • Which emission is created by the heat in the combustion process?
    5·2 answers
  • What is the law of physics<br><br><br> 10 points if you tell me the answer and your name
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!