004-002-001
Else If: Grade Classification
Easy
Problem Description
Else If: Grade Classification
In this problem, you will create a program that classifies an input score into 5 grade levels (A through E) using else if branching — 80+ for A, 60+ for B, 40+ for C, 20+ for D, and below 20 for E — and displays the result to standard output.
Learning Objective: Perform multi-level conditional branching with else if
Evaluate test score in 5 levels. Display A-E grade based on score.
Input
Line 1: Score (integer)
Output
Score: [score] pts
Grade: [A/B/C/D/E]
Criteria: 80+ A, 60+ B, 40+ C, 20+ D, <20 E.
Test Cases
※ Output examples follow programming industry standards
Normal case
Input:
85
Expected Output:
Score: 85 pts Grade: A
Normal case
Input:
55
Expected Output:
Score: 55 pts Grade: C
Your Solution
Current Mode:● My Code
99
1
2
3
4
5
6
7
8
9
10
›
⌄
⌄
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
// Write your code here
sc.close();
}
}
0 B / 5 MB
You have 10 free executions remaining
