Skip to content

Instantly share code, notes, and snippets.

@rlbisbe

rlbisbe/payroll.scala

Last active Oct 13, 2015
Embed
What would you like to do?
object Payroll {
def printSalary(employee: Employee) {
val currentYeay = 2001
employee match {
case Intern(stay) =>
println(stay * 300)
case Dev(startYear) =>
println(1000 + (currentYeay - startYear) * 500)
case Manager(startYear, direct) =>
println(1000 + (currentYeay - startYear) * 500 + direct.length * 20)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.