this is the entire code so far. everything seems to be working except the file stream variables.

Code:

#include <iostream>
#include <iomanip>
#include <string>
#include <fstream>
using namespace std;
void getNumbers (double num, int& count, char yn, ofstream& outData);
double averageNumbers (double num, double sum, double average, int count, ifstream userData);
int main ()
{
string sentinel;
double num, sum, average;
int count;
char yn;
ofstream outData;
ifstream userData;
cout << "To continue with the program enter 'continue'. Otherwise enter 'STOP'";
cin >> sentinel;
if (sentinel != "STOP")
void getNumbers (double num, int& count, char yn, ofstream& outData);
double getAverage (double num, double sum, double average, int count, ifstream userData);
cout << "The numbers you entered are: " << userData <<endl;
cout << "The average of the numbers is: " << average <<endl;
cout << "To continue with the program enter 'continue'. Otherwise enter 'STOP': ";
cin >> sentinel;
}
return 0;
}
void getNumbers (double num, int& count, char yn, ofstream& outData)
{
ofstream outData;
outData.open("numbers.txt");
count = 0;
cout << "Would you like to average some numbers? ";
cout << "Enter Y for yes or N for no." <<endl;
cin >> yn;
do
{
cout << "Enter a number you wish to average: ";
cin >> num;
outData << num << " ";
count++;
cout << "Would you like to enter another number? " ;
cout << "Enter Y for yes or N for no." <<endl;
cin >> yn;
}
while (yn != 'N');
outData.close();
}
double averageNumbers (double num1, double sum, double average, int count, ifstream userData)
{
ifstream userData;
userData.open("numbers.txt");
sum = 0;
while (!userData.eof())
{
cin >> num;
sum = sum + num;
}
average = sum/count;
return average;
}