import java.io.*;
import java.util.*;
import java.lang.*;
public class Assignment10
{
public static double lowestScore = Double.MAX_VALUE;
public static double highestScore = Double.MIN_VALUE;
static String[] names = new String[9];
public static void getName() throws FileNotFoundException
{
Scanner inFile = new Scanner(new FileReader("data.txt"));
for(int i = 0; i < names.length; i++)
{
names[i] = inFile.next() + " " + inFile.next();
inFile.nextLine();
}
System.out.print(Arrays.toString(names));
}
public static void getScore() throws FileNotFoundException
{
Scanner inFile = new Scanner(new FileReader("diving_data.txt"));
double[] scores = new double[72];
Double total = 0.00;
Double Sum1, Sum2, Sum3, Sum4, Sum5, Sum6, Sum7, Sum8, Sum9;
int index = 0;
while(inFile.hasNext()) {
if(inFile.hasNextDouble()) {
scores[index++] = inFile.nextDouble();
}
else {
inFile.next();
}
}
Sum1 = scores[0] + scores[1] + scores[4] + scores[5] + scores[6] + scores[7];
Sum2 = scores[8] + scores[9] + scores[11] + scores[12] + scores[13] + scores[14];
Sum3 = scores[16] + scores[17] + scores[20] + scores[21] + scores[22] + scores[23];
Sum4 = scores[24] + scores[25] + scores[26] + scores[28] + scores[29] + scores[30];
Sum5 = scores[32] + scores[33] + scores[35] + scores[36] + scores[37] + scores[38];
Sum6 = scores[40] + scores[41] + scores[42] + scores[43] + scores[45] + scores[46];
Sum7 = scores[48] + scores[49] + scores[52] + scores[53] + scores[54] + scores[55];
Sum8 = scores[56] + scores[58] + scores[59] + scores[60] + scores[61] + scores[62];
Sum9 = scores[66] + scores[67] + scores[68] + scores[69] + scores[70] + scores[71];
System.out.println(Sum1); // test
}
public static void main(String[] args) throws FileNotFoundException
{
getScore();
getName();
}
}
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.
Our community of experts have been thoroughly vetted for their expertise and industry experience.
This award recognizes a member of Experts Exchange who has made outstanding contributions to the community within their first year as an expert. The Rookie of the Year is awarded to a new expert who has the highest number of quality contributions.
This award recognizes a member of Experts Exchange who has made outstanding contributions to the community within their first year as an expert. The Rookie of the Year is awarded to a new expert who has the highest number of quality contributions.