Answer to Question #272243 in C++ for Bryson Fugarino

Question #272243

C++ Code


Competition Score 


the assignment must have a score system of 10 points from 10 judges, for the 10 athletes that are participating in the competition, the score should be from 0 to 10 from each judge to the 10 athletes. an example for one of the 10 athletes is shown below.


Jake Miller's results:

8.10, 7.10, 9.40, 7.20, 9.20, 6.40, 9.50, 8.40, 6.70, 6.60

The highest score of 9.50 and the lowest score of 6.40 were dropped

The average score is 7.84




1
Expert's answer
2021-11-27T11:34:51-0500
#include <iostream>
using namespace std;

int main( )
{
    double sum = 0;
    double average  = 0;
    double lowest = 999999;
    double highest = 0;
    double arr[11];
    string name;
    cout<<"Enter the student's name: ";
    cin>>name;
    cout << "Please enter 10 scores from 10 judges" << endl;
    


    for (int i = 0; i < 10; i++)
    {
        cout << "Please enter a score: ";
        cin >> arr[i];
    }


    for (int i = 0; i < 10; i++)
    {
        sum += arr[i];


        if (arr[i] < lowest)
        {
            lowest = arr[i];
        }


        if (arr[i] > highest)
        {
            highest = arr[i];
        }
    }
    average  = sum/10;
    cout<<name<<"'s results"<<endl;
    for (int i = 0; i < 10; i++)
    {
    	
        cout << arr[i]<<" ";
    }


    cout << "\nThe lowest score of: " << lowest ;
    cout << " and the highest score is: " << highest <<" were dropped"<<endl;
    cout << "The average score is: " << average << endl;


    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS