Monday, 27 April 2020

Student grade and marks


Write a program to display the student grade and division according to their marks

class  GD
{
    public static void main(String arg[])
    {
        int  a = 317  ;         
        if(a>300)
        {
            System.out.println(" The student grade is 'A' and got '1st Division' ");
        }       
        else if(a>=225 && a<300 )
        {
             System.out.println(" The student grade is 'B' and got '2nd Division' ");
        }
        else if(a>=165 && a<225 )
        {
             System.out.println(" The student grade is 'C' and got '3rd Division' ");
        }
        else
        {
            System.out.println(" FAIL ");
        }
    }
}


No comments:

Post a Comment