017-006-001

Evaluator Pattern: Unified Method

Easy

Problem Description

Evaluator Pattern: Unified method

In this problem, you will create a program that reads an evaluation type (normal/strict) and a score, calls the evaluate() method on one of two classes (GradeEvaluator or StrictEvaluator) each applying different criteria, and displays the evaluation result to standard output.

Learning Objective: Control program flow uniformly by multiple classes having the same method name

Create a grade evaluation system. Both GradeEvaluator and StrictEvaluator classes have an evaluate() method and perform evaluation with different criteria. Learn that the same method name enables the caller to evaluate in a unified way.

Input

Line 1: Evaluation type (integer, 1=normal/2=strict)
Line 2: Score (integer, 0-100)

Output

Evaluation Result:
Type: [type]
Score: [score]points
Result: [result]
```java

Evaluation criteria:
- Normal evaluation (type 1): 60 or above=Pass, below 60=Fail
- Strict evaluation (type 2): 80 or above=Pass, below 80=Fail

## Examples

### Example 1: Normal evaluation passing
Input:
```java
1
75
```java
Output:
```java
Evaluation Result:
Type: Normal
Score: 75points
Result: Pass
```java

### Example 2: Strict evaluation failing
Input:
```java
2
75
```java
Output:
```java
Evaluation Result:
Type: Strict
Score: 75points
Result: Fail
```java

### Example 3: Normal evaluation boundary
Input:
```java
1
60
```java
Output:
```java
Evaluation Result:
Type: Normal
Score: 60points
Result: Pass

Test Cases

※ Output examples follow programming industry standards

Normal case
Input:
1
50
Expected Output:
Evaluation Result:
Type: Normal
Score: 50points
Result: Fail
Normal case
Input:
2
90
Expected Output:
Evaluation Result:
Type: Strict
Score: 90points
Result: Pass

Your Solution

Current Mode: My Code
GradeEvaluator.java🔒
StrictEvaluator.java🔒
Solution.java🔒
3/6 ファイル166B
public class GradeEvaluator {
}
0 B / 5 MB

You have 10 free executions remaining