You were at the 2008 Olympics. You were watching Gymnastics at the National Indoor Stadium in Beijing. There were ten judges in the Stadium. Another ten judges were at a remote venue. The judges give the gymnasts a score from 1 - 10 (they can give scores such as 9.3, 8.5 as well).
You were not satisfied with the displaying of the scores of the gymnasts in the stadium because no average is displayed. Since you brought with you your Apple, you decided to make your own program for the average score.Store the scores of the judges in Stadium in one array. The judges' score from the remote venue should be stored in a separate array.
Create a third array. Copy the judges' (the 20 judges) scores in this third array. Compute the average of the scores given by the judges. In computing for the average, the minimum and the maximum scores should not be included. Display this average. Also display the judges who gave the gymnast the lowest and highest scores.
-----------we are not yet allowed to used the functions..pls..!!!!,, help me to finish this code.. i don't know what will i do next..i don't know how to drop the lowest and highest score then compute its average.. pls.. kindly check at my codes..
--i'm just new in programming language.
----►here is my codes:
Code:
#include <iostream.h>
void main()
{
float arr[10], sum=0,arr2[10], sum2=0;
cout<<"Beijing, Gymnast Competition Olympics year of 2008."<<endl;
cout<<"scores of the judges in the stadium:"<<endl;
for(int i=0; i<10; i++){
cin>>arr[i];
for(i=0; i<10; i++)
sum = arr[0] + arr[1] + arr[2] + arr[3] + arr[4] +arr[5] + arr[6] + arr[7] + arr[8] + arr[9];
float ave = (float)sum/10;
cout<<"The average of the judges in the stadium is "<<ave<<"."<<endl;
}
cout<<"scores of the judges in the remote venue:"<<endl;
for(int g=0; g<10; g++){
cin>>arr2[g];
for(g=0; g<10; g++)
sum2 = arr2[0] + arr2[1] + arr2[2] + arr2[3] + arr2[4] +arr2[5] + arr2[6] + arr2[7] + arr2[8] + arr2[9];
float sum_of_ave = (float)sum2/10;
cout<<"The average of the judges in the remote venue is "<<sum_of_ave<<"."<<endl;
}
cout<<"scores from judges in the stadium and in the remote venue in the gymnastics:"<<endl;
float arr3[20], sum3=0 ,low=0, high=0;
arr3[20]=arr[0] + arr[1] + arr[2] + arr[3] + arr[4] +arr[5] + arr[6] + arr[7] + arr[8] + arr[9]+arr2[0] + arr2[1] + arr2[2] + arr2[3] + arr2[4] +arr2[5] + arr2[6] + arr2[7] + arr2[8] + arr2[9];
for(int k=0; k<20; k++)
cin>>arr3[k];
{
for(int k=0; k<20||k>20; k++)
if (arr3[k]<low)
low=arr3[k];
if (arr3[k]>high)
high= arr3[k];
}
float total=(float)sum3/18;
cout<<"The average of the gymnast is"<<total<<endl;
cout<<"The lowest score is"<<low<<endl;
cout<<"The highest score is"<<high<<endl;
}