Hello, im doing a project and need some help.
my project is have to make a program for 5 judges. at the start the first thing asked is how many competitors are there.
then it asks the first judge what hes gives for the first competitior, then what the second judge gives him and so on.
then it goes on to the next competitior until they are all done.
the scores from the judges can only be from 0.0 to 6.0, and they are a float.
also the program cannot end unless it is told so, so end program Y/N and if n it will ask that again. if N then it will close.
The five scores for each judge must be averaged after their five results. so i remove the highest and lowest and then muliply the other three by 3.
my main problem is that i can do the program for 1 competitor, but if i repeat that for as many competitors for the amount that the user puts in how would i make it that they make sperate varibales and not get mixed up?
heres what i have so far and its working.
#include<iostream.h>
#include<conio.h>
int main()
{
float judge1high, judge1secondhigh, judge1thirdhigh, judge1forthhigh, judge1low, judge1average;
float judge2high, judge2secondhigh, judge2thirdhigh, judge2forthhigh, judge2low, judge2average;
float judge3high, judge3secondhigh, judge3thirdhigh, judge3forthhigh, judge3low, judge3average;
float judge4high, judge4secondhigh, judge4thirdhigh, judge4forthhigh, judge4low, judge4average;
float judge5high, judge5secondhigh, judge5thirdhigh, judge5forthhigh, judge5low, judge5average;
float total;
cout<<"\n\n\t\t\t\t==================";
cout<<"\n\n\t\t\t\tOLYMPIC GAMES 2012";
cout<<"\n\n\t\t\t\t==================";
//Judge 1
cout<<"\n\n\t\t\tJudge 1 enter highest score to lowest score: \n\n";
cin>>judge1high>>judge1secondhigh>>judge1thirdhigh>>judge1forthhigh>>judge1low;
judge1average=(judge1secondhigh+judge1thirdhigh+judge1forthhigh)/3.0;
cout<<"\n\n\t\t\tThe average for judge 1 is: "<<judge1average;
//judge 2
cout<<"\n\n\t\t\tJudge 2 enter highest score to lowest score: \n\n";
cin>>judge2high>>judge2secondhigh>>judge2thirdhigh>>judge2forthhigh>>judge2low;
judge2average=(judge2secondhigh+judge2thirdhigh+judge2forthhigh)/3.0;
cout<<"\n\n\t\t\tThe average for judge 2 is: "<<judge2average;
//judge 3
cout<<"\n\n\t\t\tJudge 3 enter highest score to lowest score: \n\n";
cin>>judge3high>>judge3secondhigh>>judge3thirdhigh>>judge3forthhigh>>judge3low;
judge3average=(judge3secondhigh+judge3thirdhigh+judge3forthhigh)/3.0;
cout<<"\n\n\t\t\tThe average for judge 3 is: "<<judge3average;
//Judge 4
cout<<"\n\n\t\t\tJudge 4 enter highest score to lowest score: \n\n";
cin>>judge4high>>judge4secondhigh>>judge4thirdhigh>>judge4forthhigh>>judge4low;
judge4average=(judge4secondhigh+judge4thirdhigh+judge4forthhigh)/3.0;
cout<<"\n\n\t\t\tThe average for judge 4 is: "<<judge4average;
//judge 5
cout<<"\n\n\t\t\tJudge 5 enter highest score to lowest score: \n\n";
cin>>judge5high>>judge5secondhigh>>judge5thirdhigh>>judge5forthhigh>>judge5low;
judge5average=(judge5secondhigh+judge5thirdhigh+judge5forthhigh)/3.0;
cout<<"\n\n\t\t\tThe average for judge 5 is: "<<judge5average;
total=(judge1average+judge2average+judge3average+judge4average+judge5average);
cout<<"\n\n\n\n\n\t\tThe total for this competitor is "<<total;
cout<<"\n\n\n\n\n\t\t\t Press any key to continue";
getch();
return 0;
}