Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class P02Grades {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double gradeInput = Double.parseDouble(scanner.nextLine());
- printGradeInWord(gradeInput);
- }
- public static void printGradeInWord(double grade) {
- if (grade >= 2 && grade <= 2.99) {
- System.out.println("Fail");
- } else if (grade <= 3.49) {
- System.out.println("Poor");
- } else if (grade <= 4.49) {
- System.out.println("Good");
- } else if (grade <= 5.49) {
- System.out.println("Very good");
- } else {
- System.out.println("Excellent");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement