Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Simple Conditions
- */
- import java.util.Scanner;
- public class _02b_ExcellentOrNot
- {
- public static void main(String[] args)
- {
- Scanner scan = new Scanner(System.in);
- double grade = Double.parseDouble(scan.nextLine());
- // Using ternary operator (?:) to print the correct result
- // result = condition ? Statement1 : Statement2;
- System.out.println((grade >= 5.50) ? "Excellent!" : "Not excellent.");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment