Question: a. (JAVA) Explain in a few sentences (1-5) the behavior of the following program (what does the program trying to do, input, and output?). You
a. (JAVA) Explain in a few sentences (1-5) the behavior of the following program (what does the program trying to do, input, and output?). You may want to run the above code with a big enough input integer to check the execution time.

b. Modify the above code with the following requirements:
- The above code only reads one integer input from the user on Console. You need to change the code to read a sequence of integer inputs and store them into an array, i.e., arrUpper
- Add code to prompt the user to enter the number of threads in the pool. Then, read the user input into an integer variable such as num_thread_pool
- Besides the newSingleThreadExecutor() method, the ExecutorService class supports another method to create a fixed-size thread pool: newFixedThreadPool(int size). Now, modify the above code to change from newSingleThreadExecutor() to newFixedThreadPool(). You need to use the above num_thread_pool variable to pass to this method.
- Finally, modify the two lines of code inside the try block to use a for loop to submit a new Summation task instance of each element in the array arrUpper
c. Run your modified code with the same numbers of the input integers but changing the input number of threads in the pool. Compare the execution time with such a different number of threads in the pool and discuss your findings.
- Below is a sample output of the modified program to give you an idea of how to modify the given code correctly:

import java.util.Scanner; import java.util.concurrent.*; class Summation implements Callable
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
