Answer:
Deque: You need to keep a record of the ages of the last 50 customers visit a restaurant. As new customers come in you delete the age that has been in the list the longest.
Tuple: You need to store the GPS coordinates of the hospitals in a state in order to find the nearest hospital for ambulance helicopters.
List: You write a loop to save anywhere from 10 to 100 values from a user. You will pass the collection to a function to find the average.
Explanation: Just got the results back no thanks to the guy above
Answer:
The solution is provided in the explanation section.
Detailed explanation is provided using comments within the code
Explanation:
import java.util.*;
public class Main {
//The Bubble sort method
public static void bb_Sort(int[] arr) {
int n = 10; //Length of array
int temp = 0; // create a temporal variable
for(int i=0; i < n; i++){
for(int j=1; j < (n-i); j++){
if(arr[j-1] > arr[j]){
// The bubble sort algorithm swaps elements
temp = arr[j-1];
arr[j-1] = arr[j];
arr[j] = temp;
}
}
}
}
public static void main(String[] args) {
//declaring the array of integers
int [] array = new int[10];
//Prompt user to add elements into the array
Scanner in = new Scanner(System.in);
//Use for loop to receive all 10 elements
for(int i = 0; i<array.length; i++){
System.out.println("Enter the next array Element");
array[i] = in.nextInt();
}
//Print the array elements before bubble sort
System.out.println("The Array before bubble sort");
System.out.println(Arrays.toString(array));
//Call bubble sort method
bb_Sort(array);
System.out.println("Array After Bubble Sort");
System.out.println(Arrays.toString(array));
}
}
Clock rate is simply the number of clock cycles a computer can perform in a second
Computer B should be designed to have a clock rate of 4GHz
The given parameters are:
--- time on computer A
--- computer A clock
--- time on computer B
Start by calculating the period of computer A
So, we have:
Rewrite as:
So, we have:
Next, we calculate the required number of clocks on computer A
So, we have:
Computer B requires 1.2 times as many clock cycles as A.
So, we have:
This gives
The clock period of computer B is:
So, we have:
Lastly, the clock rate of computer B is:
Express in gigahertz
Hence, computer B should be designed to have a clock rate of 4GHz
Read more about clock rates at:
Answer:
4 GHz
Explanation:
Time taken for computer A to execute the program is = 10 secs
Given frequency of the clock for computer A is = 2 GHz
We know Clock period = 1 / frequency = 1 / 2 * 109 = 0.5 ns
Number of clocks requried to execute the program in computer A is
= Total Execution time / clock period = 10 / 0.5 * 10-9 = 20 * 109 clocks
Given Time taken for computer B to execute the program is = 6 secs
Given computer B requries 1.2 times as many clocks as computer A
implies number of clocks to execute program in computer B = 1.2 * 20 * 109 = 24 * 109
Here clock period of computer B = Total execution time / number of clocks
= 6 secs / 24 * 109
= 0.25 ns
Hence clock rate = frequency is = 1 / clock period = 1 / 0.25 ns = 4 GHz.
environmentvariable.
resultvariable.
independentvariable.
constant.
Answer: An objective function in linear programming is a decision variable.
Explanation: An objective function is a function which has the target towards the model whether it should be maximized or minimized according to the relation between the variables present in the function. There are set of variables which are responsible for the controlling of objective function that is known as decision variables.
Answer:
As u are the in charge of system maintainance u have to maintain safety and security to the system.as the system maintainance is a very big role and u can say it is the key to ur company or to ur work.
Answer: True
Explanation: File allocation table(FAT) is the part of the file system that helps the hard drives .It is used for the management of the files and data which gets stored in the hard drive by the operating system. It can also help in the extension or expansion of the hard drive storage.
It also keeps tracing the files and data accordingly. This table works for the portable devices ,cameras etc. Thus, the statement given is true.
Answer:
(III) machines don't strike or file grievances.
(IV) machines are always less expensive than human labor.
Explanation:
The advantage of automation among the option is:
(III) machines don't strike or file grievances - Machine has the advantage of not going on strike or filing grievances. It just obey instruction. Strike are human way of showing grievances. With automation, there is no issue of strike or filing for grievance.
(IV) machines are always less expensive than human labor - Machines as a means of automation are very cheap when compared to human labor. The only added cost for machine is the added cost after the cost of purchase. For human labor, the cost is not fixed or predictable.