Attached Files In a diving competition each contestants scor

Attached Files:

In a diving competition, each contestant\'s score is calculated by dropping the lowest and highest scores and then adding the remaining scores. Write a program that reads the provided data file formatted as depicted in the following table. For each diver output the diver\'s name and total score using the above scoring rules. Format each diver\'s total score to two decimal places. So for example, the output for Chen Ruolin below would be: Chen Ruolin – 56.90 points.

Diver

Score 1

Score 2

Score 3

Score 4

Score 5

Score 6

Score 7

Score 8

Chen Ruolin

9.2

9.3

9

9.9

9.5

9.5

9.6

9.8

Emilie Heymans

9.2

9.2

9

9.9

9.5

9.5

9.7

9.6

Wang Xin

9.2

9.2

9.1

9.9

9.5

9.6

9.4

9.8

Paola Espinosa

9.2

9.3

9.2

9

9.5

9.3

9.6

9.8

Tatiana Ortiz

9.2

9.3

9

9.4

9.1

9.5

9.6

9.8

Melissa Wu

9.2

9.3

9.3

9.7

9.2

9.2

9.6

9.8

Marie-Eve Marleau

9.2

9.2

9.2

9.9

9.5

9.2

9.3

9.8

Tonia Couch

9.2

9

9.1

9.5

9.2

9.3

9.4

9.6

Laura Wilkinson

9.7

9.1

9.3

9.4

9.5

9.4

9.6

9.2

Your program must read the data in from the provided data file and use arrays to store that data. Once all the data has been read in the program needs to calculate each diver\'s total points and output that diver\'s name and total points. Where total points is calculated based on the scoring rule defined above.

Attached file diving_data.txt

Diver

Score 1

Score 2

Score 3

Score 4

Score 5

Score 6

Score 7

Score 8

Chen Ruolin

9.2

9.3

9

9.9

9.5

9.5

9.6

9.8

Emilie Heymans

9.2

9.2

9

9.9

9.5

9.5

9.7

9.6

Wang Xin

9.2

9.2

9.1

9.9

9.5

9.6

9.4

9.8

Paola Espinosa

9.2

9.3

9.2

9

9.5

9.3

9.6

9.8

Tatiana Ortiz

9.2

9.3

9

9.4

9.1

9.5

9.6

9.8

Melissa Wu

9.2

9.3

9.3

9.7

9.2

9.2

9.6

9.8

Marie-Eve Marleau

9.2

9.2

9.2

9.9

9.5

9.2

9.3

9.8

Tonia Couch

9.2

9

9.1

9.5

9.2

9.3

9.4

9.6

Laura Wilkinson

9.7

9.1

9.3

9.4

9.5

9.4

9.6

9.2

Solution

Dear Student,

Please wait i am updating the answer...

#include<iostream>
#include<cstring>
#include<fstream>
#include<iomanip>
using namespace std;
int main()
{
int i;
string name(\"\");
float score1[10],score2[10],score3[10],score4[10],score5[10],score6[10],score7[10],score8[10];
ifstream infile;
infile.open(\"diving_data.txt\");
if(!infile)
{
cout << \"can not open the file\";
return 1;
}
else
{
cout <<\"diver\"<<\"\\t\\t\\t\"<<\"Score1\"<<\"\\t\"<<\"Score2\"<<\"\\t\"<<\"Score3\"<<\"\\t\"<<\"Score4\"<<\"\\t\"<<\"Score5\"<<\"\\t\"<<\"Score6\"<<\"\\t\"<<\"Score7\"<<\"\\t\"<<\"Score8\"<<endl;
while(infile.eof())
{
infile >> name[i];
infile >> score1[i];
infile >> score2[i];
infile >> score3[i];
infile >> score4[i];
infile >> score5[i];
infile >> score6[i];
infile >> score7[i];
infile >> score8[i];
}
for(i=1;i<9;i++)
        {
        if(score1[0] < score1[i])
        {
           score1[0] = score1[i];
        }
        }

Attached Files: In a diving competition, each contestant\'s score is calculated by dropping the lowest and highest scores and then adding the remaining scores.
Attached Files: In a diving competition, each contestant\'s score is calculated by dropping the lowest and highest scores and then adding the remaining scores.
Attached Files: In a diving competition, each contestant\'s score is calculated by dropping the lowest and highest scores and then adding the remaining scores.
Attached Files: In a diving competition, each contestant\'s score is calculated by dropping the lowest and highest scores and then adding the remaining scores.

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site