Question: C++ computer science 135 help please!!! I'm having trouble with this final project and any help would be appreciated. Not having much success reading in

C++ computer science 135 help please!!!
I'm having trouble with this final project and any help would be appreciated. Not having much success reading in a file and putting the results in an output file of my naming. Please help...code is attached.
#include
#include
#include
#include
#include
using namespace std;
const string PROGRAMMER_NAME = "Matthew Harper";
// Global constant
// Prototypes
void file_input();
int data();
void sort(int a[], int n);
void minimum(int a[], int n);
void maximum(int a[], int n);
void average(int a[], int n);
void sd(int a[], int n);
void median(int a[], int n);
int get_mode();
/* -----------------------------------------------------------------------------
FUNCTION: main()
DESCRIPTION: .
RETURNS: 0
NOTES:
------------------------------------------------------------------------------- */
int main()
{
file_input();
cout
cout
cout
system("pause");
return 0;
}
/* -----------------------------------------------------------------------------
FUNCTION: file_input()
DESCRIPTION: array of integer type
RETURNS: 0
NOTES:
------------------------------------------------------------------------------- */
void file_input()
{
ifstream infile;
cout
while (true)
{
string infilename;
getline(cin, infilename);
infile.open(infilename.c_str());
if (!infile) break;
cout
}
}
/* -----------------------------------------------------------------------------
FUNCTION: data()
DESCRIPTION: array of integer type
RETURNS: 0
NOTES:
------------------------------------------------------------------------------- */
int data()
{
return 0;
}
/* -----------------------------------------------------------------------------
FUNCTION: sort()
DESCRIPTION: sort an array of integer type in ascending order
RETURNS:
NOTES:
------------------------------------------------------------------------------- */
void sort(int a[], int n)
{
for (int x = 0; x
for (int y = 0; y
if (a[y] > a [y + 1]) {
int temp = a[y + 1];
a[y + 1] = a[y];
a[y] = temp;
}
}
}
}
/* -----------------------------------------------------------------------------
FUNCTION: get_min()
DESCRIPTION: function will get the minimum value from array
RETURNS: 0
NOTES:
------------------------------------------------------------------------------- */
void minimum(int a[], int n)
{
int min = a[0], i;
for (i = 0;i if (min>a[i]) min = a[i]; cout } /* ----------------------------------------------------------------------------- FUNCTION: get_max() DESCRIPTION: function will get the maximum value from array RETURNS: 0 NOTES: ------------------------------------------------------------------------------- */ void maximum(int a[], int n) { int max = 0, i; for (i = 0; i if (max cout } /* ----------------------------------------------------------------------------- FUNCTION: get_average() DESCRIPTION: function will compute the average RETURNS: 0 NOTES: ------------------------------------------------------------------------------- */ void average(int a[], int n) { int i; float sum = 0.0, ave; for (i = 0;i sum += a[i]; ave = sum / n; cout } /* ----------------------------------------------------------------------------- FUNCTION: get_SD() DESCRIPTION: function will compute standard deviation RETURNS: 0 NOTES: ------------------------------------------------------------------------------- */ void sd(int a[], int n) { float ans, sum = 0.0, mean; int i; for (i = 0; i sum += a[i]; mean = sum / 10; for (i = 0; i ans += pow(a[i] - mean, 2); ans = sqrt(ans / n); cout } /* ----------------------------------------------------------------------------- FUNCTION: get_median() DESCRIPTION: function will compute the median RETURNS: 0 NOTES: ------------------------------------------------------------------------------- */ void median(int a[], int n) { sort(a, n); if (n % 2 != 0) // odd { int temp = ((n + 1) / 2) - 1; cout } else // even { cout } } /* ----------------------------------------------------------------------------- FUNCTION: get_mode() DESCRIPTION: function will compute the mode RETURNS: 0 NOTES: ------------------------------------------------------------------------------- */ int get_mode() { return 0; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
