Student and Leader
Submit solution
Points:
20
Time limit:
1.0s
Memory limit:
10M
Author:
Problem types
Allowed languages
Java 19
Description
請設計一個簡單的學生計分系統。教室內共有 6 位學生,學生分為一般學生 Student 與組長 Leader,其中 Leader 繼承自 Student。每位學生都有姓名與分數,組長額外擁有 bonus 分數。請使用陣列儲存 6 筆學生資料,並依序輸出每位學生的姓名與最後分數。
Requirements
Student包含姓名與分數,Leader繼承Student,並額外擁有 bonus。Student直接輸出 score,Leader需輸出 score + bonus。
Sample Input
Student Amy 80
Leader Bob 75 5
Student Cindy 90
Student David 60
Leader Eric 70 10
Student Fanny 85
Sample Output
Amy 80
Bob 80
Cindy 90
David 60
Eric 80
Fanny 85
Comments