Answer:
import java.util.Arrays;
import java.util.Scanner;
public class num1 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.println("Enter length of the array:");
int len = in.nextInt();
double [] temps = new double[len];
double avgTem;
int k =0;
double total = 0;
for( k=0; k<temps.length; k++){
System.out.println("Enter values for the array");
temps[k]=in.nextDouble();
}
System.out.println("The Arrays contains the following values");
System.out.println(Arrays.toString(temps));
// Computing the average of the values
for(k=0; k<temps.length; k++){
total = total+temps[k];
}
avgTem = total/(temps.length);
System.out.println("The average Temperature is: "+avgTem);
}
}
Explanation:
- Using Java programming language
- Import the Scanner class to receive user input
- Prompt User for the length of the Array, receive and store in a variable len;
- Declare a new double array of size len double [] temps = new double[len];
- Using a for loop, continually prompt user to enter values into the array
- Display the values of the array using Java's Arrays.toString method
- Use another for loop to add up all the elements in the arraay and store in the variable called total
- Outside the second for loop calculate the average avgTem = total/(temps.length);
- Display the average temp.
Answer:
(i) Prevention is more important than detection and recovery.
(ii) Detection is more important than prevention and recovery.
(iii) Recovery is more important than prevention and detection.
Explanation:
(i) Prevention is more important than detection and recovery.
Prevention of attack can be through various applications for example a walk through gates are placed in order to prevent any attacker from entering the premises and causing harm.
(ii) Detection is more important than prevention and recovery.
Detection of an attack can be done through for example a security alarm can detect an attack and inform others.
(iii) Recovery is more important than prevention and detection.
Recovery of an attack can be done by for example an insurance which will recover a portion of loss occurred during the attack.
Can look under the design tab to find a handful of slide themes to choose from including an option to browse from to get a theme that you personally saved.
What are the answer choices
Answer:
Explanation:
The code for the given problem is written below
.data
A : .word 1 2 3 4 5 6 7 8 9 10
.text
la $s5,A
li $s1,0 # load g
li $s2,10 # load h
li $s3,0 # load i
li $s4,1 # load j
loop:
mul $s6,$s3,4
add $s6,$s6,$s5 #address of A[i]
lw $s6,($s6) #get value of A[i] in s3
add $s1,$s1,$s6 #g = g+A[i]
add $s3,$s3,$s4 # i = i+j
bne $s3,$s2,loop #if i!=h jump to loop