confused with arrays

I am a complete beginner so bare with me please.
(problem) Write a program that aks the user for a file name. Assume the file contains a series of numbers, each written on a seperate line. The program should read the contents of the file into an array and then display the following data:
*The lowest number of array
**The highest number of array
*The avesrage number of array
*The total number of array

My code

#include <iostream>
#include <fstream>
using namespace std;

int main()
{
ifstream infile;

const int ARRAY_SIZE = 11;
int numbers[ARRAY_SIZE];
int count = 0;
int total = o;
ifstream inputFile;

inputfile.Open(" ");
while (count < ARRAY_SIZE && inputFile >> numbers[count])
count++;

for (count = 0; count < ARRAY_SIZE; count++)
{
infile >> array[count];
total += array[count];
}

int lowest = array[0];
int highest = array[0];
for (count = 0; count < ARRAY_SIZE; count++)
{
if (array[count] > highest)
highest = array[count];
if (array[count] < lowest)
lowest = array[count];
}
cout << "Total: " << total << endl;
cout << "Average: " << total/2 << endl;
cout << "Hihgest: " << highest << endl;
cout << "Lowest: " << lowest << endl;

infile.close();

system("PAUSE");

return 0;
}
Topic archived. No new replies allowed.