// C++ code to determine mean and standard deviation
#include <iostream>
#include <iomanip>
#include <fstream>
#include <vector>
#include <stdlib.h>
#include <math.h>
using namespace std;
int main()
{
double X1,X2,X3,X4,X5;
double mean, standard_deviation;
cout << "Enter first number: ";
cin >> X1;
cout << "Enter second number: ";
cin >> X2;
cout << "Enter third number: ";
cin >> X3;
cout << "Enter fourth number: ";
cin >> X4;
cout << "Enter fifth number: ";
cin >> X5;
mean = (X1+X2+X3+X4+X5)/5;
standard_deviation = sqrt((pow((X1-mean),2) + pow((X2-mean),2) + pow((X3-mean),2) + pow((X4-mean),2) + pow((X5-mean),2) )/5);
cout << "\nMean: " << mean << endl;
cout << "Standard Deviation: " << standard_deviation
<< endl;
return 0;
}
/*
output:
Enter first number: .5
Enter second number: 2.3
Enter third number: 4.2
Enter fourth number: 1.4
Enter fifth number: 6.4
Mean: 2.96
Standard Deviation: 2.11149
*/
Write a program that takes as input five numbers and outputs the mean (average) and standard...
4. Write a C++ program Write a program that takes as input five numbers and outputs the mean (average) and standard deviation of the numbers. If the numbers are xi, Xa, x3, Xa, and xs, then the mean is x = (Xi + X2 + X3+ X4 + Xs)/5 and the standard deviation is: Your program must contain at least the following functions: a function that calculates and returns the mean and a function that calculates the standard deviation. 30...
Please help! We use Java JGrasp. Write a Java program to take the input of 5 numbers and output the mean (average) and standard deviation of the numbers. If the numbers are x1, x2, x3, x4, and x5, the formula for mean is X = (x1 + x2 + x3 + x4 + x5)/5 And the formula for standard deviation is You can also break standard deviation down like this: 1. Work out the Mean (the simple average of the...
Average and Standard Deviation of 4 numbers
**c++**
Write an input function to input 4 doubles. then write a function
that computes the average of 4 doubles and returns the average and
the standard deviation. Write a output routine that shows the 6
numbers. Please feel free to use sub-functions to break up your
code.
you can name the four variables a1, a2, a3, a4, or something
equally simple as long as you are consistent.
Average (or mean) is...
Write a program in C++ to calculate the average (mean) and the standard deviation of a list of numbers using vectors. Your program should... Prompt for the number of values the user wishes to enter Prompt the user to enter the values one at a time for the number of requested values into a vector Calculate and display the Mean and Standard Deviation The flow of your code should be similar to: int main() { /** Prompt the user and...
Assignment: Write a program that prompts the user to enter 10 numbers, and then displays the mean and standard deviation of these numbers I already have the source code all done. I just need this translated into a flowchart. Again I just need the flowchart, not any source code. I have already provided the source code below. Need Flowchart version of my code Here is the source code: public class Mean_Standard_Deviation { public static void main(String[] args) { ...
Write a program that computes the average and standard deviation of four scores. The standard deviation is defined to be the square root of the average of the four values. Use two functions. One function to calculate the average, this function should be with Return Type "double". Second Function should be to calculate standard deviation, this function should be with Return Type "void". Allow the program to continue until the user tells the program he/she is finished. This is for...
In java, write a program that gets 10 integer numbers from the user using user input, and then calculates and display the sum of the numbers that have been read. Program Requirements: Write the program in three versions with three loops. Put all three loops in the main method of your source code. version1: use a while loop. version2: use a do-while loop. version 3: use a for loop. For each version, use a loop to input 10 int numbers from the user...
In java, write a program that gets 10 integer numbers from the user using user input, and then calculates and display the sum of the numbers that have been read. Program Requirements: Write the program in three versions with three loops. Put all three loops in the main method of your source code. The program must be in one file. version1: use a while loop. version2: use a do-while loop. version 3: use a for loop. For each version, use a loop to...
Write a program that takes in a line of text as input, and outputs that line of text in reverse. The program repeats, ending when the user enters "Quit", "quit", or "q" for the line of text.Ex: If the input is:Hello there Hey quitthen the output is:ereht olleH yeHThere is a mistake in my code I can not find. my output is : ereht olleH ereht olleHyeHHow can I fix this?I saw some people use void or the function reverse but we didnt...
(1) (50%) Write a C program that takes as input a fully parenthesized, arithmetic expression of binary operators +, -,*,/, and converts the expression into a binary expression tree. Your program should take input from the command line. The entire expression should be in a character string without any space in it An input string only includes floating numbers in the format of Y.YY, that is, one digit to the left of the decimal point and two digits to the...