// function declarations
double getAverage (int *grades, int size);
double getMedian (int *grades, int size);
double getSd (int *grades, int size);
void sortGrades (int *grades, int size);
int
main ();
// Declaring variables
int size, val;
// setting the precision to two decimal places
std::cout << std::setprecision (2) << std::fixed;
// Getting the input entered by the user
cout << "Please Enter Number of Grades For Child Process?? :";
cin >> size;
// Creating array dynamically
int *grades = newint[size];
/* Getting the inputs entered by the user
* and populate those values into array
*/
for (int i = 0; i < size;)
{
while (true)
{
cout << "Please Enter Grade again #" << i + 1 << ":";
cin >> val;
if (val < 0 || val > 100)
{
cout << "** Invalid.Must be between 0-100. **" << endl;
continue;
}
else
{
grades[i] = val;
i++;
break;
}
}
}
// calling the functions
double avg = getAverage (grades, size);
double median = getMedian (grades, size);
double sd = getSd (grades, size);
sortGrades (grades, size);
//displaying the average , median ,Standard Deviation
cout << "Child process has completed the average computation" << endl;
cout << "Child process can now display the Average! :" << avg << endl;
cout << "Child process has completed the median computation" << endl;
cout << "Child process can now display the Median!:" << median << endl;
cout << "Child process has completed the Standard-deviation computation" <<
endl;
cout << "Child process can now display the Standard Deviation :" << sd <<
endl;