1. Engineering
  2. Computer Science
  3. 1 implement a function named calculatemean this function takes two...

Question: 1 implement a function named calculatemean this function takes two...

Question details

1. Implement a function named calculateMean(). This function takes two parameters, an integer indicating the size of the array of values (n), and an array of integers. This function will return a value of type double. The functions should calculate the mean for any array of any sized passed in to it, as described above.

2. Implement a second function named calculateStandardDeviation(). This function takes the same two parameters, the size of the array of values (n) and an array of integers. This function will also return a double result. The function will calculate and return the standard deviation of any array of integers of any size passed to it. Some further requirements of this function. You must demonstrate the use of predefined functions from such as the pow() and sqrt() functions. Also, you must call the calculateMean() function from this function, e.g. do not repeat the calculation of the mean value, but reuse your previous function to do this work to obtain x.

Have to implement a code that outputs this:

The calculated mean is: 5.6363636

The calculated standard deviation is: 2.6206428

C++ thank you! □ E a l er e din a £ TH-GCC 4.9.2 64-bit Release globals) roject Classes Debug assg-01.cpp 2author Jane Programmer з *@cwid 12345678 4 @cLass COSC 2336, Spring 2019 S eide Visual Studio Community 2017 6 date January 12, 2019 7Bassg Assignment e1 9 @description Assignment 01, practice on functions, user defined 10types and arrays 12 #include ostream> 13 #includeiomanip> 14 using namespace std 17main 18 The main entry point for this progrom. Execution of this program 19 wiLl begin with this main fanction. 21 aram arge The commond Line argument count which is the number of 22and Line arguments provided by user when they started 23theprogram. 24 礻@param argv The commond Line arguments, on array of character arrays. 27礻e-eturns An it yolue indicating program exit status. UsuaLLy e 28is returned to indicate normil exit and a non-zero value is returned to indicate an ernor condition 31 int main(int argc, char** argv) 32GI int n 22; int xl 5, 8, 3, 7, 9, 2, 7, double xbar e.e doublc std 6.85 l calculate and display mean of values //xbar Ξ calculateltean(n, x)i cout << The calculated mean is:setprecision(8) << xbar < endl colculate and display standard devtotion of values (n, x) //std- colculateSt cout << The calculated standard deviation is: < setprecision(8) < std << endlj // return to indicate successful completion 43 47 return 83 48 Find Results Length: 1455 Compiler Resources alh compile Log e/ Debug Done parsing in 0.453 seconds 0Lines: 48L 123456

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution