Created
March 7, 2021 15:36
-
-
Save sonumehrotra/f3b38f7c255eb8747173fc77068f7296 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
import CompanySalaryApplication._ | |
object CompanyABonus: | |
given CompanyBonus = CompanyBonus(1000) | |
object CompanyA extends App with SalaryComputation: | |
import CompanyABonus.given | |
val jack = Employee("Jack", 8000) | |
val jill = Employee("Jill", 10000) | |
println(s"Jack's salary is ${computeSalary(jack)}") | |
println(s"Jill's salary is ${computeSalary(jill)}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment