Reputation: 21
I am just starting making small applications and I was trying to make an application that shows the user now much interest he/she would get after a year. My code looks like this http://pastebin.com/K1LuSZsq and my display has three buttons, the first is the place where you input the amount of money you have, the second is the % intrest and the third is the output. The problem I am having is that it is not calculating the (intrest/100), and just displaying 0: http://prntscr.com/42tnr1. Any help is greatly appreciated!
Upvotes: 0
Views: 29
Reputation: 44814
In you code you have
double test = original/100;
where original
is an int
An int divided by and 100 (also an
int) will give you an
int`
In other word, the result will be converted to an int
e.g
result = 5 / 100;
The result will be 0
Upvotes: 1