write a program in java to enter the percentage of a student with reference to the table..... percentage 90to100 grade distinction ,80 to 89 grade A, 60 to 79 grade B, 40 to 59, grade C, less than 40 % grade D
Answers
Answered by
2
Question:-
Write a program in java to enter the marks percentage of a student with reference to the table and display its grade.
90-100% Distinction
80-89% A
60-79% B
40-59% C
<40% D
Program:-
import java.util.*;
class Program
{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
System.out.print("Enter the marks percentage: ");
double m=sc.nextDouble();
String g="";
if(m>=90 && m<=100)
g="Distinction";
else if (m>=80)
g="A";
else if(m>=60)
g="B";
else if(m>=40)
g="C";
else
g="D";
System.out.println("Grade is: "+g);
}
}
Similar questions
Math,
2 months ago
Accountancy,
2 months ago
Science,
5 months ago
English,
10 months ago
Geography,
10 months ago