015-005-001
Member Card Type Check
Easy
Problem Description
In this problem, you will create a program that defines a MemberCard base class with GoldCard and SilverCard subclasses, reads card types from standard input, and uses the instanceof operator to print discount information. Read the number of cards and each card type ("gold", "silver", or "basic") from standard input. Implement CardChecker.getDiscountInfo() to use instanceof to identify the card type and return the appropriate discount message.
Test Cases
※ Output examples follow programming industry standards
Normal case
Input:
1 gold
Expected Output:
Gold discount: 20%
Normal case
Input:
1 silver
Expected Output:
Silver discount: 10%
Your Solution
Current Mode:● My Code
MemberCard.java🔒
GoldCard.java🔒
SilverCard.java🔒
CardChecker.java🔒
Main.java🔒
5/6 ファイル472B
9
1
2
›
⌄
class MemberCard {
}
0 B / 5 MB
You have 10 free executions remaining
