Question

In: Computer Science

Write a program, using C#, windows forms, that will find the mean and standard deviation of...

Write a program, using C#, windows forms, that will find the mean and standard deviation of a number of data points. The ONE PROGRAM should allow the user to enter data manually OR via a text file. The program should be very easy to use.

I will also need a step by step how to set up window for the answer. Please and thank you!!

Solutions

Expert Solution

Program:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Find_Mean_StandardDeviation
{
public partial class Form1 : Form
{
double[] points;
public Form1()
{
InitializeComponent();
}

private void btn_GenerateNumbers_Click(object sender, EventArgs e)
{
lstPoints.Items.Clear();
int num;
num = Convert.ToInt32(txtNum.Text );
//generate 1 to N numbers
Random rand = new Random();
points = new double[num];

//Generating numbers from 0 and 100

for (int i = 0; i < num; i++)
{
points[i] = rand.Next(100); //storing generated numbers in the array
}

for (int i = 0; i < points.Length; i++)
{
lstPoints.Items.Add(points[i]); //adding all points to listbox (lstPoint) from the array
}
}

private void btn_calculate_Click(object sender, EventArgs e)
{
double sum = 0.0, sumSD = 0, mean, v, SD;

//Calculating mean

for (int i = 0; i < points.Length ; i++)
{
sum=sum+points[i];
}
mean = sum / points.Length; //getting mean
txtMean.Text = Math.Round(mean,2).ToString();

//calculating standard deviation

for (int i = 0; i < points.Length; i++)
{
sumSD = sumSD + Math.Pow((points[i]-mean ),2);
}

v = sumSD / points.Length;

SD = Math.Sqrt(v);

txtSD.Text = Math.Round(SD,2).ToString();
}
}
}

Output:


Related Solutions

Using R: write a program that finds the standard deviation between each column. Find the average...
Using R: write a program that finds the standard deviation between each column. Find the average standard deviation for Set A and B, and then use that average to guess the next (fifth) column. Set A: 2, 5, 7, 8 Set B: 2, 3, 6, 9
***IN C# ONLY, USING WINDOWS FORMS*** --NO JAVA--. Create a GUI application in C# that calculates...
***IN C# ONLY, USING WINDOWS FORMS*** --NO JAVA--. Create a GUI application in C# that calculates and displays the total travel expenses of a business person on a trip. Here is the information that the user must provide: • Number of days on the trip • Amount of airfare, if any • Amount of car rental fees, if any • Number of miles driven, if a private vehicle was used • Amount of parking fees, if any • Amount of...
using Windows 32 bit framework , Write an assembly language program to find the second minimum...
using Windows 32 bit framework , Write an assembly language program to find the second minimum element (formally, second minimum is larger than the minimum but smaller than all the other elements in the array) of an array of size 100. Note: You can define the array as nbrArray DWORD 23 45 21 67 78 95 dup(?) and show that your program works for the first five elements. Display the second minimum in a message box using Input output macro
Must be in Visual C# using windows forms : Create an application that opens a specified...
Must be in Visual C# using windows forms : Create an application that opens a specified text file and then displays a list of all the unique words found in the file. Hint: Use a LINQ method to remove all duplicate words.
a) the mean is b) the variance is c) the standard deviation is
activities 0 1 2 3    4 5 6 7 probability 0.058 0.121 0.161 0.178 0.217 0.128 0.084 0.053 a) the mean is _______ b) the variance is ____________ c) the standard deviation is_____________  
Write a program that calculates mean and standard deviation for four user entered values. The most...
Write a program that calculates mean and standard deviation for four user entered values. The most common measures of a sample are the mean and the standard deviation. the mean is the sum of the values divided by the number of elements in the data set. The dispersion - or spread in the values - is measured by the standard deviation The equation for the mean is x¯ = x1 + x2 + · · · + xn The equation...
Write a program that calculates mean and standard deviation for four user entered values. The most...
Write a program that calculates mean and standard deviation for four user entered values. The most common measures of a sample are the mean and the standard deviation. the mean is the sum of the values divided by the number of elements in the data set. The dispersion - or spread in the values - is measured by the standard deviation The equation for the mean is x¯ = x1 + x2 + · · · + xn The equation...
Write a program that calculates mean and standard deviation for four user entered values. The most...
Write a program that calculates mean and standard deviation for four user entered values. The most common measures of a sample are the mean and the standard deviation. the mean is the sum of the values divided by the number of elements in the data set. The dispersion - or spread in the values - is measured by the standard deviation The equation for the mean is x¯ = x1 + x2 + · · · + xn The equation...
*****Using Java Write a program that finds the standard deviation while also using a graphical user...
*****Using Java Write a program that finds the standard deviation while also using a graphical user interface.
What is the benefit of using mean deviation over standard deviation?
What is the benefit of using mean deviation over standard deviation?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT