answer.
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]
2 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]2 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
Why can a failure in a database environment be more serious than an error in a nondatabase environment?
Elina [12.6K]
Failure in a database environment is more serious then a non data base because if you lose important information you may not get it back and failure in a nondatabase environment the problem may be more easier to solve
5 0
2 years ago
Read 2 more answers
Which telecommunications device is widely used in industries that require closed communication?
Stella [2.4K]

The telecommunications device that  is widely used in industries that require closed communication are walkie-talkies. Correct answer: D

Walkie-talkies are hand-held, portable, two-way radio transceivers which enable secure communication between the two points, without being part of a network.

3 0
2 years ago
Read 2 more answers
Digital cellphones use __________ to reduce the size of the channels that are required by scattering the digital fragments of co
Yuri [45]

Digital cellphones use Digital Compression to reduce the size of the channels that are required, by scattering the digital fragments of conversations over many channels

7 0
2 years ago
Which word in brackets is most opposite to the word in capitals? PROSCRIBE (allow, stifle, promote, verify)​
Sunny_sXe [5.5K]

the answer would be stifle

7 0
2 years ago
Read 2 more answers
Charlie has a large book collection. He was keeping track of it in a spreadsheet, but it has grown big enough that he wants to c
zepelin [54]

Answer:

Check the explanation

Explanation:

Ans 1) storing the data in one single row comes with its own barriers and that is if you delete one of the record in the spreadsheet, all the equivalent records which you didn't wanted to delete would be deleted. For take for instance, if you wish to delete the record of author "James Taylor" then all the books he has written would also be deleted from the spreadsheet.

Ans 2) In 1NF, all row is expected to have only 1 tuple, but here in this spreadsheet the title field for Author "James Taylor" has 2 books, so it would be separated into single rows.

Ans 3) The table in the attached image below doesn't delete with Delete anomaly, i.e., for author "May Norton" if you delete this record, then the only book written by her would be deleted.

So, you have to convert this table into 2NF.

Make separate tables for Author and Book

Author(Author Name, Author Country)

Books(Author Name, Book title, Publisher, Publisher Location, Year, price)

This cannot be normalized any further.

3 0
2 years ago
Other questions:
  • How efficient would a 6-bit code be in asynchronous transmission if it had 1 parity bit, 1 start bit, and 2 stop bits?
    5·1 answer
  • Discuss how the user-designer communications gap can cause a good project to go bad.
    8·1 answer
  • Blender questions
    8·2 answers
  • In your own words, what is pair-programming? What is the role of the driver? What is the role of the navigator? What are some be
    15·1 answer
  • Suppose a host has a 1-MB file that is to be sent to another host. The file takes 1 second of CPU time to compress 50%, or 2 sec
    12·1 answer
  • What is the Gain (dB) of a transmission if the Maximum Data Rate is 1 Gbps and the Bandwidth =7000 MHz? Group of answer choices
    6·1 answer
  • Which of the following should get a Page Quality (PQ) rating of Low or Lowest? Select all that apply. True False A page with a m
    8·1 answer
  • int decode2(int x, int y, int z); is compiled into 32bit x86 assembly code. The body of the code is as follows: NOTE: x at %ebp+
    5·1 answer
  • Information systems cannot solve some business problems. Give three examples and explain why technology cannot help.
    11·1 answer
  • Define a method printAll() for class PetData that prints output as follows with inputs "Fluffy", 5, and 4444. Hint: Make use of
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!