Advertisement
MOHD_NASIR_UDDIN42

Conditional Statement

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