I'm trying to get the highest and lowest number entered by user. I got this. I just new in programming. There are 3 errors.
import java.io.*;
public class HighestToLowest
{
public static void main(String []args)throws IOException{
{
BufferedReader dataIn = new BufferedReader(new InputStreamReader(System.in));
double[] input = new double[8];
int index;
int highIndex = 0;
int lowIndex = 0;
double sum = 0;
System.out.println("Enter The Scores Of Judges: ");
for (index = 0; index<8; index++){
System.out.print("Enter The Score" + (index + 1) + ": ");
input[index] = Double.parseDouble(dataIn.readLine());
}
for (index = 1; index < 8; index++)
if(input[highIndex] < input[index])
highIndex = index;
for (index = 1; index < 8; index++)
if (input[lowIndex] > input[index])
lowIndex = index;
for (index = 0; index < 8; index++)
sum = sum + input[index];
try
{
input[index] = Double.parseDouble(dataIn.readLine());
}
catch(IOException e)
{
System.out.println("error");
}
if(sum>index)
{
sum=highIndex;
}
if(sum>=index)
{
index=lowIndex;
}
}
System.out.print("Highest is: + highIndex");
System.out.print("Lowest is: + lowIndex");
System.out.printf("The Contestant Receives a total of %.2f", (sum - highIndex - lowIndex));
}
}