Question
14.19 Lab 8b: Calculating Stats // this is for zybooks lab for c++ programming. In this lab we will write 3 functions: GenData: This function
14.19 Lab 8b: Calculating Stats // this is for zybooks lab for c++ programming.
In this lab we will write 3 functions:
GenData: This function will take an integer parameter and return a vector with that many random integers generated in the range of 0 and 100 (rand()%101). Seed the random number generator with 22.
Mean(): This function will take a vector and return the mean. Variance(): This function will take a vector and return the variance.
In Main:
Use GenData to generate a vector with 100 random values.
Use Mean() to calculate the mean of the vector, and print formatted with 2 decimal points as below:
"Mean=25.11"
Use Variance() to calculate the variance of the vector, and print formatted with 2 decimal points as below:
"Variance=25.11"
Example Output: 83, 89, 54, 38, 2, 84, 47, 88, 78, 55, Mean=51.62 Variance=905.08
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