Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please write the code only in C++. Show after that the code debugs. Write a program that calculates the sample mean of a collection of
Please write the code only in C++. Show after that the code debugs.
Write a program that calculates the sample mean of a collection of numbers that the user enters. Y our program should prompt the user for the amount of numbers, and then all of the numbers. The calculation should then be done according to the formula: sample mean, x = , where N is the size of the sample. Test case: enter: 1, 2, 3, 4,5. Test case: enter: 4, 6, 8, 10, 12. 3.0 8.0 Next, your program should caleculate the sample variance of the collection of numbers. sample variance, "-"ELN--, where N is the size of the sample. Test case: enter 7-3.0; 1,2,3, 4, 5. o'-2.5 Test case: enter:8.0; 4, 6, 8, 10, 12 e*= 10.0Step 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