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;

        }

Edited 3 Years Ago by Dani: Formatting fixed

Comments
Use code tags.

Your braces are weird; main doesn't have an ending brace before you start the next function, and you seem to have some mal-formed if statements in regards to the braces.

Re-think where the braces go, and that will help.

This article has been dead for over six months. Start a new discussion instead.