016-003-001

Inheritance Basics: super Call in Card Inheritance

Easy

Problem Description

inheritance Basics: super Call in Card inheritance

In this problem, you will create a program that implements a Card class and a GoldCard class that inherits from it, using super to call the parent class constructor while displaying each card's information to standard output.

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

Normal case
Input:
CARD001
1000
100
Expected Output:
=== Gold Card ===
Card ID: CARD001
Points: 1000
Bonus: x100
Normal case
Input:
GOLD999
5000
500
Expected Output:
=== Gold Card ===
Card ID: GOLD999
Points: 5000
Bonus: x500

Your Solution

Current Mode: My Code
Card.java🔒
GoldCard.java🔒
Main.java🔒
3/6 ファイル147B
⚠️警告
  • No main method found
import java.util.Scanner;

class Card {
}
0 B / 5 MB

You have 10 free executions remaining