Looking to see if anyone has some advice for me.... I'm creating a program for class that is supposed to output the the winner of a talent show based on 5 judges scores. Everything runs fine however i am unable to figure out how to store and output the winners name along with their high score. I am not allowed to use arrays at the moment ... Any Ideas? This Is The Major Part To My Program
Apologies in advance I tried to make easier for you to read but couldn't figure out an easy way in this text box.
#include <iostream>
#include <string>
using namespace std;
// Creating Functions For Call Within Int Main()
double calcavg_Score(double, double, double, double, double);
double find_Lowest(double, double, double, double, double);
double find_Highest(double, double, double, double, double);
int main()
{
// Defining Variables For User Input
int P1;
int P2;
int P3; // -------------- P = Points Thus Is = Score
int P4;
int P5;
string name;
// Defining Variables For The Usages Of Functions
double score1 = 0;
double score2 = 0;
double score3 = 0;
double score4 = 0;
double score5 = 0;
// Beginning Source Code For User Input
cout << "Enter The Name of The Contestant, If There Are No More Contestants Enter Done" << endl;
cin >> name;
cout << " " << endl;
do
{
for (int judge = 1; judge < 5; judge++)
{
cout << "Enter Judge " << judge << " Score ";
cin >> P1;
score1 += P1;
judge++;
while (P1 < 1 || P1 > 10)
{
cout << "Invalid Entry! Score Must Be Between < 1 - 10 >" << endl;
cout << "Enter Judge 1 Score ";
cin >> P1;
}
while (P5 < 1 || P5 > 10)
{
cout << "Invalid Entry! Score Must Be Between < 1 - 10 >" << endl;
cout << "Enter Judge 5 Score ";
cin >> P5;
}
}
cout << " " << endl;
cout << " " << endl;
cout << "Enter The Name of The Contestant, If There Are No More Contestants Enter Done" << endl;
cin >> name;
cout << " " << endl;
}
// Creating A Way To Exit Loop With The Word "Done" And Initializing Function To Variables
while (name != "done");
double average = calcavg_Score(score1, score2, score3, score4, score5);
cout << average << endl;