Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Hello. I need help finishing this code. I forget exactly how to set up the two f

ID: 3640915 • Letter: H

Question

Hello. I need help finishing this code.  I forget exactly how to set up the two functions at the bottom of the code w/ their appropriate calls. The numbers in the array will be of type double. The do-while loop inside main() reads in numbers and put them into the array. The do-while loop should continue to read in numbers until either: the user types a negative number, or 100 numbers have been read. I also have to write the condition for the do-while where specified.
Define a function that takes a partially filled array of numbers as its arguments and returns the standard deviation of the numbers in the partially filled array. Since a partially filled array requires two arguments, the function will actually have two formal parameters: an array parameter and a formal parameter of type int that gives the number of array positions used. Embed your function in a suitable test program.


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

const int MAXSIZE = 100;

int main()
{
double array1[100];
int i = 0;
double somenumber;

do
{
cout << "Please enter a number to enter into the array or a negative number to stop." << endl;
cin >> somenumber;
if (somenumber = 0)
{
array1[i] = somenumber;
i++;
}
} while ( /* WHAT IS THE CONDITION HERE? */ );

cout << "There were " << " numbers entered into the array." << endl;

// FUNCTION CALL TO FUNCTION THAT PRINTS ARRAY GOES HERE
// FUNCTION CALL TO STANDARD DEIVATION FUNCTION GOES HERE


return 0;
}


//New function here
//comments describing what this function does, what is passed to it, what it sends back, etc.
void PrintArray(const double a1[], int size)
{

}

//New function here
//comments describing what this function does, what is passed to it, what it sends back, etc.
double stdDev(double s[], int size)
{
// FUNCTION CALL TO AVERAGE IN HERE
}

double average(double s[], int size)
{
double sum = 0;

for(int i = 0; i &lt; size; i++) {
sum += s[i];
}

return sum / size;
}


Thank you for any help.

Explanation / Answer

#include #include using namespace std; void PrintArray(const double [], int); double stdDev(double [], int); double average(double [], int); const int MAXSIZE = 100; int main() { double array1[100]; int i = 0; double somenumber; do { cout = 0) { array1[i] = somenumber; i++; } } while (somenumber >= 0 && i < 100 ); cout