Created
October 3, 2022 22:04
-
-
Save rmg007/6d00b20d7db8e1669442a81af7d0edec to your computer and use it in GitHub Desktop.
learn and dive into Java Course. if-else lecture
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.Scanner; | |
| public class Main { | |
| public static void main(String[] args) { | |
| Scanner in = new Scanner(System.in); | |
| int grade = in.nextInt(); | |
| if (grade >= 90) { | |
| System.out.println("A"); | |
| } else if (grade >= 80) { | |
| System.out.println("B"); | |
| } else if (grade >= 70) { | |
| System.out.println("C"); | |
| } else if (grade >= 60) { | |
| System.out.println("D"); | |
| } else { | |
| System.out.println("F"); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment