Answer:
Option (B) and (C) is the correct option to the following question.
Explanation:
Because the function is the module of the program and we call that function again and again anywhere whenever we need that function in the program.
Function is used to carry out any operation which is used in the program many times and it creates the program short and simple.
<u>For example</u>: if we need to add or multiply two numbers many times in the program then, we create one or two functions for addition and subtraction or one program for both, when we need them we call them.
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:
0.0816
Explanation:
8.16 ÷ 100 = 0.0816 (Ans)
I don’t know if this helps, but here are three types of main flows: flow of material/goods, flow of money/cash, and flow of information.