Answer:
import java.util.Arrays;
public class swap{
public static void main(String []args){
int [] arr = {2,4};
swapValues(arr);
}
public static void swapValues(int[] values){
int temp;
System.out.println(Arrays.toString(values));
temp=values[0];
values[0]=values[1];
values[1] =temp;
System.out.println(Arrays.toString(values));
}
}
Explanation:
In the program above, we created the method swapValues that receives an array of integers as parameters. in the method definition, we created a temp variable that is used to swapp the element at index 0 and index 1. Java's Arrays.to string method is used to print the array before and after the swap.
Answer:
Explanation:
The following code is written in Java. It is hard to fully create the code without the rest of the needed code including the T class and the Measurable interface. Regardless the following code can be implemented if you have that code available.
public static T minmax(ArrayList<T> mylist) {
T min = new T();
T max = new T();
for (int x = 0; x < mylist.size(); x++) {
if (mylist.get(x) > max) {
max = mylist.get(x);
} else if (mylist.get(x) < min) {
min = mylist.get(x);
}
}
return (min, max);
}
Answer:
Explanation:
temporal locality can be defined as: when a particular memory is referenced or accessed several times within a specific period of time. In the question, i think the variable that exhibit temporal locality are I, J and 0(all the variable). This is because the variable J and 0 are accessed several times within the loop. I would not have been part of it, but in the A[I][J]=B[I][0]+A[J][I], the variable "I" is also accessed in the addition. this is why it is part of the temporal locality.
Answer:
The correct answer is option (D) Identify the impact on safety of the property
Explanation:
Solution
In every Business Impact Analysis, the first and the most important step is for the CISO is to identify and estimate the impact of the aftereffects on the business and property of an organization that may be occurred from the disaster.
Physical security is very important, but it is not noticed by most organizations. It is important if you do not want anyone to take away your information or destroy it, in case of natural calamity. the reason could be that, the intruder is doing it for his personal achievement, financial gain,or seeking revenge or when one is taken unaware and becomes a target. If this security is not maintained properly all the safety measures will not be useful once the attacker gets through by gaining physical access.
Example of property can be software, equipment, facilities, company’s assets.
The expert system are given inputs such as questions, locations and information. The expert system processes and advice the user on what to do. If the user inputs the location of an oil site and ask a question if they are able to drill an oil out of the site, then the expert system calculates and gives you the answer you need. Though the expert system makes errors just like humans.