I have an exercise to do that consists of the following:
The user informs the salary, and depending on the value informed, it gains an increase according to the table. Example: From 1000 to 1500 he gains 10% From 1500 to 2000 he earns 5% 2000 he does not gain any increase.
I thought of doing using multiple ifs
, but in case, would it be better to use switch
? Why?