+ 2

Good day...In java while using switch statement, wana write something like : case salary <100000: but its not working

writing a java program using switch statement to compute the tax paid by worker those earning below 100000 pays a tax of 0.1℅, 100000 to 200000 pays 0.5%, 200000 to 400000 pays 1℅ ...

27th Jan 2017, 6:01 AM
Aregbesola Olamide Ayomide
Aregbesola Olamide Ayomide - avatar
2 Answers
+ 2
You'll want to use if...elseif conditional statements for that. Switch statements are for primitive types only and can only evaluate the value of the type being examined.
27th Jan 2017, 6:22 AM
Blightedsage
Blightedsage - avatar
+ 2
Thought as much tho was an assignment thanks bro
27th Jan 2017, 6:25 AM
Aregbesola Olamide Ayomide
Aregbesola Olamide Ayomide - avatar