1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
dolphi86 [110]
3 years ago
15

Write a function that computes the average and standard deviation of four scores. The standard deviation is defined to be the sq

uare root of the average of the four values: (si − a )2, where a is the average of the four scores s1, s2, s3, and s4. The function will have six parameters and will call two other functions. Embed the function in a program that allows you to test the function again and again until you tell the program you are finished.
Computers and Technology
1 answer:
ZanzabumX [31]3 years ago
7 0

Answer:

#include<iostream>

#include<cmath>

using namespace std;

double calAvg(double s1, double s2,double s3, double s4);

double calStandardDeviation(double s1, double s2,double s3, double s4,double average,int n);

void main()

{

 double s1,s2,s3,s4;

double avg,StandardDeviation;

char option;

   do

{

 cout<<"Enter s1:";

 cin>>s1;

 cout<<"Enter s2:";

 cin>>s2;

 cout<<"Enter s3:";

 cin>>s3;

        cout<<"Enter s4:";

 cin>>s4;

 avg=calcAvg(s1,s2,s3,s4);

        sdeviation=calcStandardDeviation(s1,s2,s3,s4,avg,4);

 cout<<"Standard deviation:"<<sdeviation<<endl;

 cout<<"Do you want to continue then press y:";

         cin>>option;

}

       while (option='y');

}

double Average(double s1, double s2,double s3, double s4)

{

return (s1+s2+s3+s4)/4;

}

double calcStandardDeviation(double s1, double s2,double s3, double s4, double mean,int n)

{

double sd;

sd=(pow((s1-mean),2)+pow((s2-mean),2)+

                     pow((s3-mean),2)+pow((s4-mean),2))/n;

sd=sqrt(sd);

return sd;

}

You might be interested in
How can E-Commerce Portals ensure Security of online Transactions by Customers?
beks73 [17]
Ffkjlfdhaslkjfhlaksdfhlkajsdfh
6 0
3 years ago
Why do meteorologists use data such as temperature, wind speed, and air
Tresset [83]

Answer:

b

Explanation:

3 0
3 years ago
Create and apply a css class named bigblue, which selects a large, blue-colored font.
a_sh-v [17]
.bigblue {
font-size: xx-large;
color: blue;
}
3 0
3 years ago
Literally not even a true question, I just want to know
german
I’m here because of k12
3 0
3 years ago
Read 2 more answers
The screen that contains the Webpage you are viewing.
11Alexandr11 [23.1K]

Answer:

the content area is the screen that contains the webpage you are viewing

7 0
3 years ago
Other questions:
  • Business Risks are ​
    15·1 answer
  • In nutanix command-line interface (ncli) commands, each entity has a unique set of actions, but a common action across all entit
    15·1 answer
  • Which is a tool that allows you to copy formatting from one place and apply it to other places?
    9·1 answer
  • Which of the following is the shortcut key combination for pasting copied text?
    11·2 answers
  • The ______ is the information center that drivers need to refer to when they're NOT scanning the road.
    14·1 answer
  • Practice problems on functions. Write C function(s) to carry out the specified tasks. For each problem, also write the suggested
    15·1 answer
  • Los antivirus no son infalibles y en ocasiones pueden darnos:
    5·1 answer
  • A city planner is using simulation software to study crowd flow out of a large arena after an event has ended. The arena is loca
    15·1 answer
  • Write a program that will input two numbers and print the larger number on the screen.
    13·1 answer
  • help this poped up on my pc im on my laptop what does it mean HELP rC % M i \g e - A u t o M e r g e d - b a s e ~ 3 1 b f 3 8 5
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!