1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
{void getJudgeData(double& jscore, int& numjudge);
int main()
{
// Constant "const" Value Declarations
const int NO_ERRORS = 0;
// Initialized Variable Declarations
int programStatus = NO_ERRORS;
// Uninitialized Variable Declarations
double jtotal, jscore, j1, j2, j3, j4, j5;
int numjudge;
numjudge = 1;
getJudgeData(jscore, numjudge);
j1 = jscore;
numjudge = numjudge + 1;
getJudgeData(jscore, numjudge);
j2 = jscore;
numjudge = numjudge + 1;
getJudgeData(jscore, numjudge);
j3 = jscore;
numjudge = numjudge + 1;
getJudgeData(jscore, numjudge);
j4 = jscore;
numjudge = numjudge + 1;
getJudgeData(jscore, numjudge);
// This prevents the Console Window from closing during debug mode using
// the Visual Studio IDE.
// Note: Generally, you should not remove this code
cin.ignore(cin.rdbuf()->in_avail());
cout << "\nPress only the 'Enter' key to exit program: ";
cin.get();
return programStatus;
}
void getJudgeData(double& jscore, int& numjudge)
{
cout << "Input the score given by Judge " << numjudge << ".\n(score between 1-10)" << endl;
cin >> jscore;}
|