2012-12-21 12:55:05 UTC
Contestant 1
8.4 9.1 8.5 8.4 9.1 8.7 8.8 9.1 =8.77
Contestant 2
7.0 7.0 7.0 7.0 7.0 7.0 7.0 7.0 =7.00
Contestant 3
8.0 7.9 8.0 8.0 8.0 8.0 8.0 8.1 =8.00
where it adds all the double numbers while taking away the high est and lowest of the scores , and averaging the total. this is what i have for the contestant 1 . can you tell me what i did wrong and what i need to fix for this one and how to tackle the next two contestants. ?
public static void main(String [] args)
{
Scanner inFile=null;
try
{
inFile=new Scanner(new File("prog215h.dat"));
}
catch(FileNotFoundException e)
{
System.out.println("File not found! ");
System.exit(0);
}
while (inFile.hasNext())
{
double file=inFile.nextDouble();
}
constent1(file);
}
public static void contestent1(double file)
{
DecimalFormat f=new DecimalFormat("#.00");
while (inFile.hasNext())
{
double max=0,small=0,big=0;
for (int count=0;count<=7;count++)
{
System.out.print(file+" ");
max+=file;
if (count==0)
{
small=file;
big=file;
}
if (count>0)
{
if (small>file)
{small=file;}
if (big
}
}
double answer=max-(small+big);
System.out.print(" = "+f.format(answer/6));
}
}
I need some help on the method connecting . for some reason the methods are not connecting with each other.