017-003-002
Static Method: Grade Judgment Utility
Easy
Problem Description
static method: Grade Judgment Utility
In this problem, you will create a program that receives a score, determines a grade (A through F) using a static method GradeUtil.judgeGrade(), and displays the result to standard output.
Learning Objective: Understand how to utilize static methods as utility class
Create static method to judge grades. Learn mechanism of static methods that can be called directly without creating instance. Understand that methods declared with public static can be called in format ClassName.methodName().
Input
Line 1: Score (0-100)
Output
=== Grade Judgment ===
Score: [score] points
Grade: [grade]
```java
Grading criteria:
- 90 or above: A
- 80 or above: B
- 70 or above: C
- 60 or above: D
- Below 60: F
## Example 1: B Grade Judgment
Input: 85
Expected output:
```java
=== Grade Judgment ===
Score: 85 points
Grade: B
```java
Explanation: 85 points is 80 or above but less than 90, resulting in B grade. GradeUtil.judgeGrade(85) returns "B" and displays result.
## Example 2: A Grade Judgment (High Score)
Input: 95
Expected output:
```java
=== Grade Judgment ===
Score: 95 points
Grade: A
```java
Explanation: 95 points is 90 or above, resulting in A grade. Static methods can be called directly without instance.
## Example 3: D Grade Judgment (Boundary)
Input: 60
Expected output:
```java
=== Grade Judgment ===
Score: 60 points
Grade: D
```java
Explanation: 60 points is boundary value resulting in D grade. Static method works correctly even at boundary values.
Test Cases
※ Output examples follow programming industry standards
Input:
85
Expected Output:
=== Grade Judgment === Score: 85 points Grade: B
Input:
95
Expected Output:
=== Grade Judgment === Score: 95 points Grade: A
Input:
60
Expected Output:
=== Grade Judgment === Score: 60 points Grade: D
Input:
55
Expected Output:
=== Grade Judgment === Score: 55 points Grade: F
❌ Some tests failed
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
