016-003-005

Inheritance Basics: super Call in Card Inheritance

Easy

Problem Description

Inheritance Basics: super Call in Card Inheritance

Learning Objective: Understand class inheritance (extends) and superclass reference (super), learn how to reuse parent class functionality

Create basic Card class and GoldCard class that inherits from it.

Test Cases

※ Output examples follow programming industry standards

Input:
CARD001
1000
100
Expected Output:
Input:
GOLD999
5000
500
Expected Output:
Input:
C
0
0
Expected Output:
❌ Some tests failed
❌ エラー発生

Your Solution

Current Mode: My Code
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 9 free executions remaining