Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- int score;
- Scanner keyboard = new Scanner(System.in);
- System.out.println("Enter your exam score");
- score = keyboard.nextInt();
- if (score < 60) {
- System.out.println("Your grade is F");
- }
- else {
- if (score < 70) {
- System.out.println("Your grade is D");
- }
- else {
- if (score < 80) {
- System.out.println("Your grade is C");
- }
- else {
- if (score <90) {
- System.out.println("Your grade is B");
- }
- else {
- if (score >= 90) {
- System.out.println("Your grade is A");
- }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment