Answer:
Makes it easier to read... summarize cite electronic versions of editions
Answer:
import java.util.ArrayList;
import java.util.Scanner;
import java.util.Collections;
public class num4 {
public static void main(String[] args) {
int sum = 0;
Scanner in = new Scanner(System.in);
System.out.println("Enter number");
int num = in.nextInt();
ArrayList<Integer> list = new ArrayList<>();
while (num >= 0){
list.add(num);
System.out.println("Enter another positive number, enter a negative to stop");
num = in.nextInt();
}
int maximum = Collections.max(list);
int listSize = list.size();
for(int i:list){
sum = sum+i;
}
double average = (double) sum/listSize;
System.out.println("Maximum number entered is "+maximum);
System.out.println("Average of the number is "+average);
}
}
Explanation:
In this program:
- A Scanner class is used to receive user input and store in a variable
- A while loop with the condition while (num >= 0) is used to ensure only non-negative numbers are entered
- An ArrayList is created and used to store all the user's valid entries
- The Max Method in the Collections class is used to find the maximum value entered
- To find the average, a for loop is used to add all elements in the list and divide by the size of the list
- Finally the Average and maximum is printed out
Answer:
1035
Explanation:
Pipelining is a technique used in carrying out several instructions at the same time. The pipeline is divided into stages, each of which is attached to the next to create a pipe-like structure.
The parallelizability is calculated by multiplying the number of different instances of a given operation by the number of pipeline stages through which the operation can be separated.
From the given information:
The no of instruction (n) to be executed on CPU = 1024
The no of stages in a pipeline K = 12
The total minimum number of cycles = k + n - 1
= 12 + 1024 - 1
= 1035
Answer:
You tell her that a <u>CD R</u> is an erasable multi session disc users can write on multiple times.