Just think of me as a total noob. I have some errors that i don't understand and could really use some help.
#include <iostream>
#include <iomanip>
using namespace std;
void Array();
int main()
{
Array();
system("pause");
return 0;
}
void Array()
{
int nStud = 0, nMovs = 0;
int * ptr_1d;
int total = 0;
double average;
//allocates an array for the number of students
cout << "Enter the number of students surveyed: " << endl;
cin >> nStud;
while ( nStud < 0 )
{
cout << "Error! Please enter a positive number: ";
cin >> nStud;
}
//allocates an array for the number of movies for each student
ptr_1d = new int [nStud];
for ( int j = 0; j < nStud; j++ )
{
cout << "How many movies for student " << (j + 1) << ": ";
cin >> nMovs;
//Calculate total movies
total = total+nMovs;
while (nMovs < 0)
{
cout << "Error! Please enter a positive number: ";
cin >> nMovs;
}
}
int temp = 0;
bool swap;
//bubble sort the number of movies
do
{ swap = false;
for (int count = 0; count < (nStud - 1); count++)
{
if (ptr_1d[count] > ptr_1d[count + 1])
{