File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
src/main/kotlin/chapter01 Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -29,11 +29,12 @@ open class PerformanceCalculator {
2929 get() {
3030 throw Error (" 서브클래스에서 처리하도록 설계되었습니다." )
3131 }
32- val volumeCredits: Int
32+ open val volumeCredits: Int
3333 get() {
34- var result = maxOf(this .aPerformance.audience - 30 , 0 )
35- if (this .play?.type == " comedy" ) result + = this .aPerformance.audience / 5
36- return result
34+ return maxOf(this .aPerformance.audience - 30 , 0 )
35+ // var result = maxOf(this.aPerformance.audience - 30, 0)
36+ // if (this.play?.type == "comedy") result += this.aPerformance.audience / 5
37+ // return result
3738 }
3839
3940 constructor (aPerformance: Performance , aPlay: Play ) {
@@ -65,6 +66,10 @@ class ComedyCalculator : PerformanceCalculator {
6566 result + = 300 * this .aPerformance.audience
6667 return result
6768 }
69+ override val volumeCredits: Int
70+ get() {
71+ return super .volumeCredits + this .aPerformance.audience / 5
72+ }
6873
6974 constructor (aPerformance: Performance , aPlay: Play ) : super (aPerformance, aPlay)
7075}
You can’t perform that action at this time.
0 commit comments