Skip to content

Instantly share code, notes, and snippets.

@sonumehrotra
Created March 7, 2021 15:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sonumehrotra/f3b38f7c255eb8747173fc77068f7296 to your computer and use it in GitHub Desktop.
Save sonumehrotra/f3b38f7c255eb8747173fc77068f7296 to your computer and use it in GitHub Desktop.
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