Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help to solve to understand. 6 sna Write a program that calculates the arithmetic mean value and standard deviation of the following array of

Please help to solve to understand.

image text in transcribed
6 sna Write a program that calculates the arithmetic mean value and standard deviation of the following array of numbers that are created on the HEAP. float Array(100 numbers) = {1.0,2.0,3.0,4.0,.....100.0} Int Fib(20 numbers) = {0,1,1,2,3, 5..........} The arithmetic mean value of an array is defined as: T = 1 +x2 + . . . + In n whereas the standard deviation(SD) is defined as follows: 2, 4, 4, 4, 5, 5, 7, 9. These eight data points have the mean (average) of 5: 2+4+4+4+5+5+7+9 8 = 5. First, calculate the difference of each data point from the mean, and square the result of each: (2 - 5)- = (-3) = 9 (5-5)- = 03 = 0 (4-5) = (-1) = 1 (5 -5) = 02 = 0 (4-5) = (-1) =1 (7 - 5)2 = 2' =4 (4-5)? = (-1)? = 1 (9 - 5)3 = 42 = 16. Next, calculate the mean of these values, and take the square root: 9+1+1+1+0+0+4+ 16 8 = 2. The program should generate the data for each type of array. The program should have overloaded function that are declared as follows: float Mean(float* f_ptr, int Size); float Mean(int *i_ptr, int Size); float SD(int *i_ptr, int Size); float SD(float *f_ptr, int Size = 10); //default value You should provide answers for the following cases: . calculate the mean of Array[100] calculate the SD of Array[100] calculate the mean for Fib[20] calculate the SD for Fib[20] . calculate the SD for Array[10] - first 10 elements of array recognize that the SD function invokes the mean function

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions