Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class StudentGrade {
- public static void main(String[] args) {
- int mark;
- Scanner scanner;
- scanner = new Scanner(System.in);
- System.out.println("Enter Mark: ");
- mark = scanner.nextInt();
- if(mark>=90) System.out.print("A");
- else if(mark>=80){
- if(mark%10>=7) System.out.print("B+");
- else if(mark%10>=4) System.out.print("B");
- else System.out.print("B-");
- }
- else if(mark>=70){
- if(mark%10>=7) System.out.print("C+");
- else if(mark%10>=4) System.out.print("C");
- else System.out.print("C-");
- }
- else if(mark>=60){
- if(mark%10>=7) System.out.print("D+");
- else if(mark%10>=4) System.out.print("D");
- else System.out.print("D-");
- }
- else System.out.print("F");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement