Answered step by step
Verified Expert Solution
Question
1 Approved Answer
My program is still incorrect PLEASE READ ALL INSTRUCTIONS First thing I would do is fix the mean function. There is a syntax error in
My program is still incorrect PLEASE READ ALL INSTRUCTIONS
First thing I would do is fix the mean function. There is a syntax error in the body of the function. Next, I would call the mean function from main and make sure it's working correctly. Then look at the standard deviation function. x is supposed to be equal to the mean, so you'll have to have the mean of the numbers before you calculate the standard deviation. As it stands now, x doesn't have anything useful in it. If you don't assign a value to a variable before you use it, it will just contain whatever garbage is in the memory the variable occupies. x needs to have the mean in it. Also, the ^ symbol will not raise a base to an exponent. Look up the pow function from the cmath library. It is discussed in the "Using Predefined Functions in a Program" section of Chapter 3 and the "Predefined Functions" section of Chapter 6. Once you've got it straightened out, add a call to your standard deviation function to main. Make sure it is also working correctly. Done delmarlearning.com AAC Instructions main.cpp include #include Instructions Write a program that takes, as input, five numbers and outputs the mean (average) and standard deviation of the numbers. If the numbers are X, X, X, Xa, and Xs. then the mean is: using na std; double int 2, double x x x +5)/ x = (X + Xg+ Xe+ Xa+Xe 5 double sto int x2, in and the standard deviation is: s={{9-x)2+(x2-x)+(X- x)2+(Xx-x2+(X5-X12/5) double x doubles (x-x)" (x3-x)2 x5-x)2) xt, x5; Your program must contain at least the following functions: a function that calculates and returns the mean and a function that calculates the standard deviation @ 2 #include Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started