Question: In Eclipse create a Scala project called ControlLab. Add a worksheet to this project called session. You should use library functions whenever possible. Problem: Elbonia
In Eclipse create a Scala project called ControlLab. Add a worksheet to this project called session. You should use library functions whenever possible.
Problem: Elbonia has a simple sliding scale income tax scheme. Your tax rate is determined by your income according to the following table:
Income------ Rate
___________________
< $20000 -> 0%
< $30000 -> 5%
< $40000 -> 11%
< $60000 -> 23%
< $100000 -> 32%
>= $100000 -> 50%
Implement a tax calculator for the Elbonians using Scala's match expression. Your calculator should throw an InvalidIncome exception if the input is negative.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
