'sh: Pause: Command not found' Error and input/output file won't open

I need some direction with the following program. It is called star search. When I try to run the program, I keep getting the following error message: 'sh: pause: command not found'. It will not tell me why I am getting the message. In addition to that the program won't read from the input and output files that I have created.

Below are the program instructions. If you do not care to read, please scroll down to see the code that I have created so far. Thanks.

Instructions
Your program will have an input file that will consist of a list of contestants. The first line of the file is an integer that says how many contestants are in the file. Each line is for one contestant and each line in the file would have the following format (the name of the input file starsearch.dat):
Contestant Name(no spaces) score1 score2 score3 score4 score5

Your program will have a function called string contestantName() that takes the file object as a reference parameter and reads the file for the name of the contestant on the current line and returns the name. This function should be called from main, once for each line of the file.
The void getJudgeData() will read from the file and not from the user. This function will still use a reference parameter for the score, and it will read the next score from the file. This function will be called five times per contestant and is called from main once for each score.
The void CalcScore() is used to calculate the score using the same formulation. However, this function will write the contestants name and score to an output file. The function will have 7 parameters instead of 5: output file (pass by reference), contestants' name, and the 5 judges scores.
The output file will be a list of contestants, where each line has the following format (name the output file results.dat):
Contestant Name(name contains no spaces) Final_Score

#include <iostream>
#include <iomanip>
#include <fstream>
#include <cmath>
#include <string>
#include <cstdlib>

using namespace std;

//Function Prototypes
void calcScore (double);
void getJudgeData (double);
string contestantName(ifstream & );

double calculatescore;
double findLowest(double &lowestScore);
double findHighest(double &highestScore);
int score1, score2, score3, score4, score5, lowestScore, highestScore, totalScore;
string contName;

ifstream inputFile;
ofstream outputFile;

int main()

{
{
ifstream thefile ("starsearch.dat"); //Input file
int name; //Name of contestant
while (thefile >> name >> score1 >> score2 >> score3 >> score4 >> score5) {
{cout << name << "," << score1 << "" << score2 << ", "<< score3 << ", " << score4 << ", " << score5 << ", ";}
if (!thefile){ //file opening error
cerr << "File will not open.";
exit(1);
}
}
}
//contestant name function

for (int count = 0; count < 2; count++)
{

string contestantName(contName);
for (int count = 0; count < 5; count++)
{



}

}
system ("pause");
}


string contestantName (string contName)
{

const int size = 81;
char name[size];

contName = name;

inputFile >> contName;

return contName;
}

double getJudgeData( ifstream& ifs )
{
inputFile>>score1>>score2>>score3>>score4>>score5;



{
void getJudgeData (double);
}
int findLowest(double &lowestScore);
{

if ((score1 <= score2) && (score1 <= score3) && (score1 <= score4) && (score1 <= score5))
{
lowestScore = score1;
}

else if ((score2 <= score1) && (score2 <= score3) && (score2 <= score4) && (score2 <= score5))
{
lowestScore = score2;
}

else if ((score3 <= score1) && (score3 <= score2) && (score3 <= score4) && (score3 <= score5))
{
lowestScore = score3;
}

else if ((score4 <= score1) && (score4 <= score2) && (score4 <= score3) && (score4 <= score5))
{
lowestScore = score4;
}

else if ((score5 <= score1) && (score5 <= score2) && (score5 <= score3) && (score5 <= score4))
{
lowestScore = score5;
}
return lowestScore;

}


double findHighest(double &highestScore);
{

if ((score1 >= score2) && (score1 >= score3) && (score1 >= score4) && (score1 >= score5))
{
highestScore = score1;
}

else if ((score2 >= score1) && (score2 >= score3) && (score2 >= score4) && (score2 >= score5))
{
highestScore = score2;
}

else if ((score3 >= score1) && (score3 >= score2) && (score3 >= score4) && (score3 >= score5))
{
highestScore = score3;
}

else if ((score4 >= score1) && (score4 >= score2) && (score4 >= score3) && (score4 >= score5))
{
highestScore = score4;
}

else if ((score5 >= score1) && (score5 >= score2) && (score5 >= score3) && (score5 >= score4))
{
highestScore = score5;
}
return highestScore;

}

{
void CalcScore (double &totalScore);

}
double findLowest(double lowestScore);
double findHighest(double highestScore);

totalScore = (((score1+score2+score3+score4+score5)-(lowestScore+highestScore))/3.0);

return totalScore;
}
First thing, please post your code encased with [code] tag, its much easier to read and therefore comprehend.

Second, "system("PAUSE");" is Windows specific as far I know. So if you are running this on non-windows you are going to get that error.

Third,
In addition to that the program won't read from the input and output files that I have created.

You havent given the full path, the relative path I believe will be the current directory, if the file you created is not in the same path as the binary then the file wont be found, and therefore wont be opened.
Topic archived. No new replies allowed.