You say that the bonus variable should have the value 20. But the bonus variable is used twice in the code posted, both times it is assigned the value 0. Therefore it is impossible for it to have a...
Type: Posts; User: Junky
You say that the bonus variable should have the value 20. But the bonus variable is used twice in the code posted, both times it is assigned the value 0. Therefore it is impossible for it to have a...
double bonus=0; // bonus initialised to zero
....
bonus = 0; // totally pointless line of code
Where in the rest of your code do you change the value of bonus?