in an examination the grades are given to the students on the basis of the average marks obtained write a program that will take the percentage that you have obtained in your Last year examination and displays the grsde as follows 80% and above, distinction an d60% or more but less than 80%,first division 45%or more but less than 60%second sectoin less than 45 % pass
Answers
Explanation:
in an examination the grades are given to the students on the basis of the average marks obtained write a program that will take the percentage that you have obtained in your Last year examination and displays the grsde as follows 80% and above, distinction an d60% or more but less than 80%,first division 45%or more but less than 60%second sectoin less than 45 % pass
import java.util.*;
public class Average
{
public static void main (String args[])
{
Scanner in = new Scanner(System.in);
double per;
System.out.println("Enter the last year percentage of the student:");
per = in.nextDouble();
if(per >= 80%)
{
System.out.println("Distinction");
}
if(per >= 60% && < 80%)
{
System.out.println("First division");
}
else if(per >= 45% && < 60%)
{
System.out.println("Second section less");
}
else(per <45%)
{
System.out.println("Pass");
}
}
]