Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ch5ex5;
- import java.util.Scanner;
- public class Ch5Ex5
- {
- public static void main(String[] args)
- {
- Scanner sc=new Scanner(System.in);
- System.out.print("Enter the percentage: ");
- double grade=sc.nextInt();
- if(grade>=90) System.out.println("The corresponding letter grade is: A");
- if(grade>=80&&grade<=89) System.out.println("The corresponding letter grade is: B");
- if(grade>=70&&grade<=79) System.out.println("The corresponding letter grade is: C");
- if(grade>=60&&grade<=69) System.out.println("The corresponding letter grade is: D");
- if(grade<60) System.out.println("The corresponding letter grade is: F");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement