Answer: Hello your question lacks some details attached below is the missing detail
answer :
a) True , B) False C) True D) True
Explanation:
a) True ; The critical section cannot be executed by more than one process at a time
b) False : The code does not satisfy the progress condition, because while loops are same hence no progress
c ) True : The code satisfies the bounded waiting condition, because of the waiting condition of the while loop
d) True : No matter how many times this program is run, it will always produce the same output, this is because of the while loop condition
true
Screenshots are basically snapshots of your computer screen. You can take a screenshot of almost any program, website, or open window. PowerPoint makes it easy to insert a screenshot of an entire window or a screen clipping of part of a window in your presentation.
Answer:
import java.util.Arrays;
import java.util.Scanner;
public class LatinHire {
public static void main(String[] args) {
Scanner in = new Scanner (System.in);
System.out.println("Enter Five integers");
int num1 = in.nextInt();
int num2 = in.nextInt();
int num3 = in.nextInt();
int num4 = in.nextInt();
int num5 = in.nextInt();
int [] intArray = {num1,num2,num3,num4,num5};
System.out.println(Arrays.toString(intArray));
System.out.println("The Maximum is "+returnMax(intArray));
System.out.println("The Minimum is "+returnMin(intArray));
}
public static int returnMax(int []array){
int max = array[0];
for(int i=0; i<array.length; i++){
if(max<array[i]){
max= array[i];
}
}
return max;
}
public static int returnMin(int []array){
int min = array[0];
for(int i=0; i<array.length; i++){
if(min>array[i]){
min= array[i];
}
}
return min;
}
}
Explanation:
- This is implemented in Java Programming Language
- Two Methods are created returnMax(Returns the Maximum Value of the five numbers) and returnMin(Returns the minimum of the five numbers)
- In the Main method, the user is prompted to enter five numbers
- The five numbers are saved into an array of integers
- The returnMax and returnMin methods are called and passed the array as parameter.
- The entire array of numbers inputted by the user as well the Max and Min are printed