This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class BinaryIntervalSearch( | |
| private val initialValue: Int, | |
| private val estimationStep: Int, | |
| private val maxValue: Int, | |
| val meetsCondition: () -> Boolean = { true } | |
| ) { | |
| fun search(doWork: (newValue: Int) -> Unit): Int { | |
| if (this.maxValue < initialValue) { | |
| throw Error("Max value cant be smaller than initial value") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export class OSVC { | |
| public readonly percentageDiscount = 0.6 | |
| constructor(public readonly expectedIncome: number) {} | |
| get totalExpenses(): number { | |
| return this.healthInsurance + this.socialInsurance + this.taxes | |
| } | |
| get netIncome(): number { |
OlderNewer