1.      Write a function to read innumbers and put them into the array. The function should continueto read in numbers until either: the user types a negativenumber, or 100 numbers (hint: MAXSIZE) have been read. Thefunction should also return the number of elements in thearray. Write comments before the function that describe whatthe function does, what it needs passed to it, what it sends backto the function call, and how it accomplishes its task.

2.      Then write a second function thatwill accept an array and print out the contents of the array. This function should accept an array and the number of elementsthat are to be printed. Before writing the code for thisfunction, write the comments.

below is what Ihot so far, and I really need help on the place where I marked(***need something here), thanks

#include
using namespace std;
int Function1(double []);
void PrintArray(const double [], int);

const int MAXSIZE =100;

int main()
{
    double array1[100];
    int count;

    count = Function1(array1);
    cout
    (***need something here) //function call tofunction that will print the array

    return 0;
}

//Write the function here to read in numbers into the array. The array is called myarray.
//add comments describing what this function does, what is passedto it, what it sends back, etc.
int Function1(double myarray[])
{
    cout
    (***need something here)
}
return 0;
}

//Write the new function here along with comments
//add comments describing what this function does, what is passedto it, what it sends back, etc.

void PrintArray(const double a1[], int size)
{
for ( int x = 0; x
{
        cout
}
}



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *