why in raiseSalary(): salary *= (100 + percent) / 100 won't work?
Code java:
// why salary *= (100+percent)/100 wont work? }public void raiseSalary(int percent){ salary = salary*(100+percent)/100;
Printable View
why in raiseSalary(): salary *= (100 + percent) / 100 won't work?
Code java:
// why salary *= (100+percent)/100 wont work? }public void raiseSalary(int percent){ salary = salary*(100+percent)/100;
Simplify the equation in the method to see if you can answer your own question. When you've obtained the simplified equation, don't forget to apply the rules of 'integer math.'