package Assignments1;
import java.util.Scanner;
public class Q5 
{
public static void main(String[] args)
    {
        {

        int size;
        Scanner reader = new Scanner(System.in);
        System.out.println("Enter the size :");
        size = reader.nextInt();
        int [] grades = new int [size];
        int sum = 0;
        double average;
        for(int i=0; i<grades.length; i++)
        {
            System.out.println("Enter the grades" +i +" :");
            grades[i] = reader.nextInt();
            sum=sum +grades[i];
        }
        System.out.println("The grades are : ");
        for(int i=0; i<grades.length; i++)
        {

            System.out.print(grades[i] + "\t");
        }

        int maxValue = grades[0];

        for(int i=1; i<grades.length; i++)
        {
            if(grades[i] > maxValue)
            {
                maxValue = grades[i];
            }
        }
        System.out.println();
        System.out.println("========================");
        System.out.println("Maximum value :"+maxValue);
        System.out.println("========================");

        int minValue = grades[0];

        for(int i=1; i<grades.length; i++)
        {
            if(grades[i] < minValue)
            {
                minValue = grades[i];
            }
        }
        System.out.println("Minimum value : " +minValue);
        System.out.println("==========================");
        System.out.println("Total :" +sum);
        average=sum / size;
        System.out.println("Average value : " +average);
        System.out.println("==========================");





    }

    }

}

Write a program called GradesStatistics, which reads in n grades (of int between 0 and 100, inclusive) and displays the average, minimum, maximum, and standard deviation. Your program shall check for valid input. You should keep the grades in an int[] and use a method for each of the computations. Your output shall look like:
Enter the number of students: 4
Enter the grade for student 1: 50
Enter the grade for student 2: 51
Enter the grade for student 3: 56
Enter the grade for student 4: 53
The average is 52.5
The minimum is 50
The maximum is 56
The standard deviation is 2.29128784747792

how to insert The standard deviation in the 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.