Hello,
Currently, i was assigned to create an array, which i have no idea what array is.
The problem is this....
2.Write a function to read in numbers and put them into the array. The function should continue to read in numbers until either: the user types a negative number, or 100 numbers (hint: MAXSIZE) have been read. The function should also return the number of elements in the array. Write comments before the function that describe what the function does, what it needs passed to it, what it sends back to the function call, and how it accomplishes its task.
3.Then write a second function that will accept an array and print out the contents of the array. This function should accept an array and the number of elements that are to be printed. Before writing the code for this function, write the comments.
#include <iostream>
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<<"There were "<<count<<" numbers entered into the array."<<endl;
//function call to for the array
return 0;
}
//Write the function here to read in numbers into the array.
//add comments describing what this function does,
int Function1(double myarray[])
{
}
//Write the new function here along with comments
//add comments describing what this function does, what is passed to it, what it sends back, etc.
void PrintArray(const double a1[], int size)
{
}