014-004-002
protected Modifier: Character Class
Easy
Problem Description
protected Modifier: Character Class
Learning Objective: Access protected fields from child class for calculations
Create Character class representing characters and Warrior class inheriting from it. Use parent's protected fields for child class-specific calculations.
Input
Line 1: Name (string)
Line 2: HP (integer)
Output
Name: [name]
HP: [HP]
Class: Warrior
Power: [HP*2]
```java
## Examples
### Example 1: Basic character
Input:
```java
Hero
100
```java
Output:
```java
Name: Hero
HP: 100
Class: Warrior
Power: 200
```java
### Example 2: Different character
Input:
```java
Knight
150
```java
Output:
```java
Name: Knight
HP: 150
Class: Warrior
Power: 300
```java
### Example 3: Boundary (minimum HP)
Input:
```java
A
1
```java
Output:
```java
Name: A
HP: 1
Class: Warrior
Power: 2
Test Cases
※ Output examples follow programming industry standards
Input:
Hero 100
Expected Output:
Input:
Knight 150
Expected Output:
Input:
A 1
Expected Output:
❌ Some tests failed
Your Solution
Current Mode:● My Code
Character.java🔒
Warrior.java🔒
Solution.java🔒
3/6 ファイル0B
⚠️警告
- No main method found
9
1
›
0 B / 5 MB
You have 9 free executions remaining
