switch
to handle intervals, he said strictly that we should use the switch and we can not use if
nor while/do
. I've tried the following code:
switch(saldo){
case 0..200:
//...
break;
}
However, I know that java does not work this way, I already searched the internet for a ..
and I did not find anything that solved my problem, how can I do that?
Statement:
4) A bank will grant special credit to its customers, variable with the average balance in the last year. Make an algorithm that reads the balance average of a customer and calculate the value of the credit according to the table below. Display a message stating the average balance and of credit. (use the case-of command and do no reps)
Average Percentage Balance
0 to 200 no credit
201 to 400 20% of the average balance amount
from 401 to 600 30% of the average balance amount
above 601 40% of the average balance amount