I was making this score calculator to take user input so they can add as many numbers as they want, entering the score works fine and so does adding, displaying the score total, displaying the score count, displaying the average, the last thing I have to do is find the standard deviation of my list I'm having some trouble so if anyone can show me how to find the standard deviation I would be very appreciative. Please Help!

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 ScoreCalculatorProj
{
    public partial class frmScoreCalculator : Form
    {
        // Creates the list where user can enter the score as many times as they please
        List<decimal> scores = new List<decimal>();
        decimal scoreaverage = 0;
        decimal scoretotal = 0;
        decimal scorestandarddev = 0;
        decimal score;
        public frmScoreCalculator()
        {
            InitializeComponent();
        }

        // Pulls out the about form when user clicks the about button
        private void btnAbout_Click(object sender, EventArgs e)
        {
            frmAbout form = new frmAbout();
            form.Show();
        }

        // Button so user input could be accepted for addition process
        // Calculates the addition of the scores entered by the user then gives total score
        private void btnAdd_Click(object sender, EventArgs e)
        {
            score = decimal.Parse(txtScore.Text);
            scores.Add(score);
            scoretotal += score;

        // Calculates the score average of the users score input
            scoreaverage = scoretotal / scores.Count;

            {
                decimal scoreaverage = scores.Average();
                decimal sumOfSquaresOfDifferences = scores.Select(score => (score - scoreaverage) * (score - scoreaverage)).Sum();
                decimal scorestandarddev = Math.Sqrt(sumOfSquaresOfDifferences / scores.Count);
            }

            // Displays the scoreaverage, scorecount, score total, as well as recieves users score input
            txtScoreaverage.Text = scoreaverage.ToString();
            txtScorecount.Text = scores.Count.ToString();
            txtScoretotal.Text = scoretotal.ToString();
            txtScorestandarddev.Text = scorestandarddev.ToString();
            txtScore.Text = "";
            txtScore.Focus();
        }

        // Button to display the user score input in a sorted order
        private void btnDisplayScores_Click(object sender, EventArgs e)
        {
            string numbersString = "";
            foreach (decimal score in scores)
                {
                numbersString += score + "\n";
            }
            MessageBox.Show(numbersString, "Sorted Scores");
        }

        // Button to clear the textbox, output labels, items from the list box, and elements of the list
        private void btnClearScores_Click(object sender, EventArgs e)
        {

            txtScore.Text = "";
            txtScore.Focus();
            scores.Clear();
            scoreaverage = 0;
            scoretotal = 0;
            scorestandarddev = 0;
            score = 0;
            txtScoreaverage.Text = "";
            txtScorecount.Text = "";
            txtScoretotal.Text = "";
            txtScorestandarddev.Text = "";
        }

        // Button to exit program
        private void btnExit_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

    }
}

you have to use double apparently but I don't understand how to set this up to find Standard deviation Please Help!

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 ScoreCalculatorProj
{
    public partial class frmScoreCalculator : Form
    {
        // Creates the list where user can enter the score as many times as they please
        List<double> scores = new List<double>();
        double scoreaverage = 0;
        double scoretotal = 0;
        double scorestandarddev = 0;
        double score;
        public frmScoreCalculator()
        {
            InitializeComponent();
        }

        // Pulls out the about form when user clicks the about button
        private void btnAbout_Click(object sender, EventArgs e)
        {
            frmAbout form = new frmAbout();
            form.Show();
        }

        // Button so user input could be accepted for addition process
        // Calculates the addition of the scores entered by the user then gives total score
        private void btnAdd_Click(object sender, EventArgs e)
        {
            score = double.Parse(txtScore.Text);
            scores.Add(score);
            scoretotal += score;

        // Calculates the score average of the users score input
            scoreaverage = scoretotal / scores.Count;

        { 
            double scoreaverage = scores.Average();
            double scorestandarddev = 0;
            foreach (double score in scores)
            {
                scorestandarddev += (score) * (score);
            }
            double sumOfDerivationAverage = scorestandarddev / scores.Count;
            Math.Sqrt(sumOfDerivationAverage - (scoreaverage * scoreaverage));
        }

        // Displays the scoreaverage, scorecount, score total, as well as recieves users score input
        txtScoreaverage.Text = scoreaverage.ToString();
            txtScorecount.Text = scores.Count.ToString();
            txtScoretotal.Text = scoretotal.ToString();
            txtScorestandarddev.Text = scorestandarddev.ToString();
            txtScore.Text = "";
            txtScore.Focus();
        }

        // Button to display the user score input in a sorted order
        private void btnDisplayScores_Click(object sender, EventArgs e)
        {
            string numbersString = "";
            foreach (decimal score in scores)
                {
                numbersString += score + "\n";
            }
            MessageBox.Show(numbersString, "Sorted Scores");
        }

        // Button to clear the textbox, output labels, items from the list box, and elements of the list
        private void btnClearScores_Click(object sender, EventArgs e)
        {

            txtScore.Text = "";
            txtScore.Focus();
            scores.Clear();
            scoreaverage = 0;
            scoretotal = 0;
            scorestandarddev = 0;
            score = 0;
            txtScoreaverage.Text = "";
            txtScorecount.Text = "";
            txtScoretotal.Text = "";
            txtScorestandarddev.Text = "";
        }

        // Button to exit program
        private void btnExit_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

    }
}

This is fake , Calculater is not derived from this coding

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.