I need help with my homework assignment. The assignments asks to enter a list of double values with the maxium to be entered is 50. I need to print out the list entered and find the largest and smallest values entered by the user. This is what I have but I'am getting an unexpected end of file error when I compile my program.
#include <iostream>
#include <cmath>
const int max=50
void readlist(double a[], int s)
void display(double a[], int s)
double largest(double a[], int s)
double lowest(double a[], int s)
int main()
{
using namespace std;
double list [max]
cout<<"Please enter a list size"<<endl;
cin>>list;
if(max>50)
{
cout<<"The size you have entered is too large."<<endl;
cout<<"The maximum size is 50."<<endl;
cout<<"Please re-enter a list size"<<endl;
return 0;
}
void display(double a[], int s)
{
for (i=0;i<size;i++)
cout<<"Please enter some double values "<<endl;
cin>>a[i];
cout<<"The list you have entered is"<<endl;
cin>>list[i];
cout<<list[i]<<" ";
if(i==5)cout<<"endl";
}
double largest(double a[], int s)
double lowest(double a[], int s)
for (i=0;i<size;i++)
if(largest<list[i])
largest=list[i];
{
cout<<"The largest value is:"<<endl;
cin>>largest;
return largest;
}
else if (lowest>list[i])
lowest=list[i];
}
cout<<"The smallest value is:"<<endl;
cin>>lowest;
return lowest;
}