Looping help
to loop the program back to the begining if i pressed y and to exit if i hit n
#include "Stat.h"
#include <iostream>
using namespace std;
void getJudgeData(int &);
double calcScore(Stat s);
int main()
{
Stat s;
int score1 = 0, score2 = 0, score3=0, score4=0, score5=0;
int x = 1;
int winner;
int z;
cout << "This program assignment number 4 was created by Jeremy Rice" << endl;
cout<< "The Next American Idol!!!"<<endl;
cout<< "Please enter your scores below!"<<endl;
do
{
cout<< "Enter contestant #"<<x<< " scores!"<<endl;
cout<<"Judge #1 what is your score: ";
getJudgeData(score1);
s.setNum(score1);
cout<<"Judge #2 what is your score: ";
getJudgeData(score2);
s.setNum(score2);
cout<<"Judge #3 what is your score: ";
getJudgeData(score3);
s.setNum(score3);
cout<<"Judge #4 what is your score: ";
getJudgeData(score4);
s.setNum(score4);
cout<<"Judge #5 what is your score: ";
getJudgeData(score5);
s.setNum(score5);
cout<<"Talent score for contestant #"<<x<<" is: ";
calcScore(s);
x++;
cout<<"Is there another contestant? (Y/N)"<<endl;
cin>>z;
}while ((z == 'y')||(z == 'Y'));
system("pause");
return 0;
}
void getJudgeData(int &getNum)
{
Stat s;
cin>> getNum;
return;
}
double calcScore(Stat s)
{
cout<<(s.getSum()- s.getMin()- s.getMax()) / 3 <<endl;
}
this part
cout<<"Is there another contestant? (Y/N)"<<endl;
cin>>z;
}while ((z == 'y')||(z == 'Y'));

