Question

In: Computer Science

c++ Given the test scores of 7 students are 96, 88, 83, 76, 90, 91, 87....

c++

Given the test scores of 7 students are 96, 88, 83, 76, 90, 91, 87. Write a program that will calculate the average and the standard deviation.

( Standard deviation is given by sqrt[ sum(score-avg)^2/(N-1) ]  )

Solutions

Expert Solution

Code:

#include <iostream>
#include<cmath>
using namespace std;
int main() {
int i;
float sum=0,temp=0;
float scores[] = {96,88,83,76,90,91,87};
// To caluculate sum of scores.
for(i=0;i<7;i++)
{
sum = sum + scores[i];
}
cout<<"The sum of scores is: "<<sum<<endl;
// To calculate average of scores.
float avg = sum/7;
cout<<"average of scores is: "<<avg<<endl;
//STANDARD DEVIATION.
for(i=0;i<7;i++)
temp = temp + pow(scores[i]-avg,2);
float sd = sqrt(temp/7);
cout<<"Standard deviation is: "<<sd<<endl;
  
return 0;
}

Screenshot:

Output:


Related Solutions

Exam 1 Scores 91, 83, 75, 85, 90, 80, 67, 82, 88, 87, 95, 91, 73,...
Exam 1 Scores 91, 83, 75, 85, 90, 80, 67, 82, 88, 87, 95, 91, 73, 80, 83, 92, 94, 68, 75, 91, 79, 95, 87, 76, 91, 85, 59, 70, 69, 78 Dummy: 0, 0 What are the Hypothesis Statement? What is Ho? What is Ha? What is the P-Value? What is the Claim? What is the Decision Rule? (Hint: Do you reject or fail to reject the null hypothesis?) What is the Level of Significance? (Hint: α) What...
Given the following students' test scores (95, 92, 90, 90, 83, 83, 83, 74, 60, and...
Given the following students' test scores (95, 92, 90, 90, 83, 83, 83, 74, 60, and 50), identify the mean, median, mode, range, variance, and standard deviation for the sample. Write a 500-750-word summary and analysis discussing the results of your calculations. State your results for the sample: the mean, median, mode, range, variance, and standard deviation Explain which method is best for this data set. Why? Conduct a one sample T-test and interpret the results (use a population mean...
Given the following students' test scores (95, 92, 90, 90, 83, 83, 83, 74, 60, and...
Given the following students' test scores (95, 92, 90, 90, 83, 83, 83, 74, 60, and 50), identify the mean, median, mode, range, variance, and standard deviation for the sample. Write a 500-750-word summary and analysis discussing the results of your calculations. State your results for the sample: the mean, median, mode, range, variance, and standard deviation Explain which method is best for this data set. Why? Conduct a one sample T-test and interpret the results (use a population mean...
Given the following students' test scores (95, 92, 90, 90, 83, 83, 83, 74, 60, and...
Given the following students' test scores (95, 92, 90, 90, 83, 83, 83, 74, 60, and 50), identify the mean, median, mode, range, variance, and standard deviation for the sample. Write a 500-750-word summary and analysis discussing the results of your calculations. State your results for the sample: the mean, median, mode, range, variance, and standard deviation Explain which method is best for this data set. Why? Conduct a one sample T-test and interpret the results (use a population mean...
92 99 96 94 94 94 90 95 90 89 89 80 83 88 88 1.  What...
92 99 96 94 94 94 90 95 90 89 89 80 83 88 88 1.  What is the n?   __________ 2.  What is ∑x ? __________ 3.  What is ∑x2? __________ 4.  What is (∑x)2? __________ 5.  What is the range?  __________ 6.  What is the mean?  __________ 7.  What is the median?  __________ 8.  What is the mode?  __________ 9.  What is the variance?  __________ 10.  What is the standard deviation?  __________ 11.  If Kara scored a 90 (x)….What is her Z-score?  __________ 12.  If Sara scored a 95….What is her T-score?  __________ 13.  Mark scored an 88 (one of...
Performance Data Group Test 1 Test 2 1 96 85 1 96 88 1 91 81...
Performance Data Group Test 1 Test 2 1 96 85 1 96 88 1 91 81 1 95 78 1 92 85 1 93 87 1 98 84 1 92 82 1 97 89 1 95 96 1 99 93 1 89 90 1 94 90 1 92 94 1 94 84 1 90 92 1 91 70 1 90 81 1 86 81 1 90 76 1 91 79 1 88 83 1 87 82 0 93 74 0...
Determine the 95% confidence interval for the following scores: 83, 92, 81, 87, 79, 93, 88,...
Determine the 95% confidence interval for the following scores: 83, 92, 81, 87, 79, 93, 88, 87, 83. Hint: You will need to determine the sample mean and standard deviation and then construct your confidence interval around these.
For the following data 86 84 91 75 78 80 74 75 87 76 82 90...
For the following data 86 84 91 75 78 80 74 75 87 76 82 90 98   68 What is the mean?    ______ What is the median?_________ What is the mode (if any)? _____ What is the standard deviation? ____ What is the variance? ______ What is the five-number summary for this data? Draw a boxplot with reasonable attention to scale. Create a stemplot of this data. Using the same data set and ignoring the fact that the 5-number summary...
93 95 93 81 88 88 84 75 89 81 92 91 83 78 88 77...
93 95 93 81 88 88 84 75 89 81 92 91 83 78 88 77 95 94 90 94 80 84 95 87 92 92 94 84 83 89 84 87 78 99 97 79 93 83 76 92 96 77 52 89 95 76 87 92 80 70 94 90 93 83 88 89 95 87 88 96 92 87 96 93 96 81 93 76 78 96 96 84 89 91 92 87 91 90 86 88...
85 1,810 90 4,825 79 438 82 775 84 1,213 96 8,692 88 2,356 76 266...
85 1,810 90 4,825 79 438 82 775 84 1,213 96 8,692 88 2,356 76 266 93 4,930 97 9,138 89 2,714 83 1,082 85 1,290 90 3,970 82 894 91 2,906 90 4,615 84 1,168 79 462 81 1,018 95 5,950 What is multiple R, R square, & Adjusted R square? Do regression model results indicate significance, meaning the results can be accepted? Yes or No. For every 1 increase in Temperature, how much do sales increase?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT