Explanation:
According to the situation mentioned in the question about the model that can make the multi threaded execution faster as compared with the single threaded counterparts programs because multi-threaded programs have the capability to execute simultaneously in multiple processes.
In this type of system ,the blocking system cannot block the complete execution because kernel thread is present for every user thread .So, if one kernel thread gets blocked , others will still keep running .
Whereas, for uni-processor system , the program has to wait for the input -output operation completion for most of the time.Thus, multi-threaded program can execute faster than uni-processor.
Format painter allows us to copy multiple fomatting styles at the same time from within a word document
There are no answrt choices it would be very helpful if you added them, then I could help you.
Answer:
PART ONE
- import java.util.Scanner;
- public class CountToLimit {
- public static void main(String[] args) {
- Scanner scnr = new Scanner(System.in);
- int countLimit = 0;
- int printVal = 0;
- // Get user input
- System.out.println("Enter Count Limit");
- countLimit = scnr.nextInt();
- do {
- System.out.print(printVal + " ");
- printVal = printVal + 1;
- } while ( printVal<=countLimit );
- System.out.println("");
- return;
- }
- }
PART TWO
- import java.util.Scanner;
- public class NumberPrompt {
- public static void main (String [] args) {
- Scanner scnr = new Scanner(System.in);
- System.out.print("Your number < 100: ");
- int userInput = scnr.nextInt();
- do {
- System.out.print("Your number < 100: ");
- userInput = scnr.nextInt();
- }while (userInput>=100);
- System.out.println("Your number < 100 is: " + userInput);
- return;
- }
- }
Explanation:
In Part one of the question, The condition for the do...while loop had to be stated this is stated on line 14
In part 2, A do....while loop that will repeatedly prompt user to enter a number less than 100 is created. from line 7 to line 10
9 is the correct answer. 4*2=8 loops are executed, moving the count from 1 to 9.