Advertisement
Ishmam_Rahman

JAVA_Grade_System

May 6th, 2021
542
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.96 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3.  
  4. public class StudentGrade {
  5.     public static void main(String[] args) {
  6.         int  mark;
  7.         Scanner scanner;
  8.         scanner = new Scanner(System.in);
  9.  
  10.         System.out.println("Enter Mark: ");
  11.         mark = scanner.nextInt();
  12.  
  13.         if(mark>=90) System.out.print("A");
  14.        
  15.         else if(mark>=80){
  16.             if(mark%10>=7) System.out.print("B+");
  17.             else if(mark%10>=4) System.out.print("B");
  18.             else System.out.print("B-");
  19.         }
  20.        
  21.         else if(mark>=70){
  22.             if(mark%10>=7) System.out.print("C+");
  23.             else if(mark%10>=4) System.out.print("C");
  24.             else System.out.print("C-");
  25.         }
  26.        
  27.         else if(mark>=60){
  28.             if(mark%10>=7) System.out.print("D+");
  29.             else if(mark%10>=4) System.out.print("D");
  30.             else System.out.print("D-");
  31.         }
  32.        
  33.         else System.out.print("F");
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement