Using java programing : Write a program using an array that will store input data. Prompt the user for and read 6 numbers between 70 and 90. Verify the numbers should be greater than 70 and less than 90. If the number is less than or equal to 70 or greater than 90, reprompt for a valid value.
The output by using the array data:
- Print all the elements of the array.
- The average of all the elements of the array.
- The minimum element with its index
- The difference between the largest and smallest elements of the array.
Ive started with
import java.util.Scanner;
public class Lab12
{
public static void main (String [] args)
{
Scanner scan = new Scanner(System.in);
double [] num= new double [6];
for ( int i=0; i < num.length;i++)
{
while (num[i] <=70 || num [i] >90)
{
System.out.println("Enter a number grater bigger then 70 and less then 90 ");
num [i]= scan.nextInt();
}
}
}}