Created
March 7, 2021 15:38
-
-
Save sonumehrotra/0f0c1a4433629f802c66808797ec8045 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 CompanyBBonus: | |
given companyBonus: CompanyBonus = CompanyBonus(2000) | |
object CompanyB extends App with SalaryComputation: | |
import CompanyBBonus.given | |
val julie = Employee("Julie", 8000) | |
val julia = Employee("Julia", 10000) | |
val employees = List(julie, julia) | |
val employeeAndSalary = employees.map(emp => emp.name -> computeSalary(emp)) | |
println(s"Map of employee and salary for company B is $employeeAndSalary") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment