File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed
src/main/kotlin/chapter01 Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -34,11 +34,7 @@ open class PerformanceCalculator {
3434 }
3535
3636 " comedy" -> {
37- result = 30000
38- if (this .aPerformance.audience > 20 ) {
39- result + = 10000 + 500 * (this .aPerformance.audience - 20 )
40- }
41- result + = 300 * this .aPerformance.audience
37+ throw Error (" 오류 발생" )
4238 }
4339
4440 else -> {
@@ -75,6 +71,16 @@ class TragedyCalculator : PerformanceCalculator {
7571}
7672
7773class ComedyCalculator : PerformanceCalculator {
74+ override val amount: Int
75+ get() {
76+ var result = 30000
77+ if (this .aPerformance.audience > 20 ) {
78+ result + = 10000 + 500 * (this .aPerformance.audience - 20 )
79+ }
80+ result + = 300 * this .aPerformance.audience
81+ return result
82+ }
83+
7884 constructor (aPerformance: Performance , aPlay: Play ) : super (aPerformance, aPlay)
7985}
8086
You can’t perform that action at this time.
0 commit comments