Home Java Student Grade Calculation using Java

Student Grade Calculation using Java

3 min read
0
0
358

This tutorial will teach how to make a  Student Grade Calculation in Java. Input the studentname and avg marks to calcuate the grade

if the average is > 85 – A

if the average is > 75 – B

if the average is > 65 – C

if the average is > 55 – S

if the average is < 45 – F

Paste the inside the Calc Button

        double maths,science,engish,tot,avg;
        String grade;
        
        maths = Integer.parseInt(txtMaths.getText());
        science = Integer.parseInt(txtSci.getText());
        engish = Integer.parseInt(txtEng.getText());
        
        
        
        tot = maths + science + engish;
        
        
        avg = tot/3;
        
        
        if(avg >= 85)
        {
            
            grade = "A";
        }
        else if(avg >= 75)
        {
            
            grade = "B";
        }
        else if(avg >= 65)
        {
            
            grade = "C";
        }
        else if(avg >= 45)
        {
            
            grade = "S";
        }
        else
        {
             grade = "F";
        }
        
        lbltot.setText(String.valueOf(tot));
        lblAvg.setText(String.valueOf(avg));
        
        lblGrade.setText(grade);

I have attached the video tutorial below it will help you  to do this  step by step.

 

Load More Related Articles
Load More By admin
  • Array counting the 0 in Java

    Create a 10 element integer array and store some integer values display as the counting of…
  • DataInputStream using Java

    in this tutorials you will be learning  DataInputStream using Java.input the integer numbe…
  • Math Function using Java

    Assume that we have to compute and print the square root of the number. [crayon-63395efaf3…
Load More In Java

Leave a Reply

Your email address will not be published.

Check Also

Angular Spring boot API Bootstrap Table load

This Angular and Spring boot tutorial will teach you how to view the records using Restful…