Last active
March 7, 2021 15:10
-
-
Save sonumehrotra/95b3693f649ef511eae65b0ca9cbccbe to your computer and use it in GitHub Desktop.
This file contains 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
object CompanySalaryApplication: | |
case class Employee(name: String, salary: Int) | |
case class CompanyBonus(amount: Int) | |
trait SalaryComputation: | |
def computeSalary(employee: Employee)(using companyBonus: CompanyBonus): Int = | |
employee.salary + companyBonus.amount |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment