<> TwoDim Array

Using a two dimensional array, I have to display a list of totaled scores for a diving contest.

Each diver has five scores and there are five dives per diver. For each score (or total?), I have to drop the highest and the lowest score, and multiply the remainder by a difficulty score.

diver number: 123

diff 4.0
scores 2.1 1.2 3.4 4.2 1.3
3.0
1.3 1.3 1.3 1.3 1.3
1.2
1.3 1.3 1.3 1.3 1.3
2.2
1.3 2.2 3.3 4.4 5.5

etc.


there is a set like this per diver.


Now, I have a function to read from a file.

void readScore(string diver[], float difficulty[], float score[][diveScore], int divers, int diff, int scores)

ifstream input;
float sum=0;

input.open("divers.dat");

{
for file open faliure
}


for int(d=o; d<divers ;d++)
{
input>>diver[d];

for (int i=0 ; i<diff ; i++)
{
input>>difficulty[i];
for (int s=0 ; s<scores ; s++)
input>>score[i][s];

}

input.close();

}

}



Now, should I perform the calculations for the min, max, sum in this function and then create a calcScore function?
Topic archived. No new replies allowed.