Answer: In operating system a code segment which accesses some shared variables or resources one at a time atomically such other no other code or process is accessing that resource or variable at the same time.
Entry section code block allows the access to the shared resource or variable and exit section code signals the termination from access to the shared resource or variable.
Explanation:
Entry and exit section codes needs to check certain properties before allowing the access and removal of access to a particular code segment.
These conditions are:
1. Bounded waiting.
2. Mutual exclusion.
3. checking thread execution status to allows other threads to enter the critical section (CS).
Answer:
Voice refers to the form of a verb that indicates when a grammatical subject performs the action or is the receiver of the action. When a sentence is written in the active voice, the subject performs the action; in the passive voice, the subject receives the action.
Answer:
Option D is the correct answer for the above question
Explanation:
Missing code: The function code is missing in the question, which defined the two return value.
Detailed Expalanation:
- The above question code is in python language, which returns the two values. So there are needs of two variable which is needed to hold the returned value from a function.
- Options b and c both states the two variable for the calling function which needs to hold the returned value and the option D states both option, hence it is a correct option while the other is not because:-
- Option a states no variable which can hold the returned value.
Answer:
Hence the code is given as follows,
import java.util.Scanner;
public class LabProgram {
public static String createAcronym(String userPhrase){
String result = "";
String splits[] = userPhrase.split(" ");
for(int i = 0;i<splits.length;i++){
if(splits[i].charAt(0)>='A' && splits[i].charAt(0)<='Z')
result += splits[i].charAt(0);
}
return result;
}
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
String s = scan.nextLine();
System.out.println(createAcronym(s));
}
}