int wordpercent = ((count/totalwords)*100);
JOptionPane.showMessageDialog(null, "Count: " + count);
JOptionPane.showMessageDialog(null, "Words: " + totalwords);
JOptionPane.showMessageDialog(null, "Character Count: " + length);
JOptionPane.showMessageDialog(null, previousletter);
JOptionPane.showMessageDialog(null, nextletter );
JOptionPane.showMessageDialog(null, "Your word makes up " + wordpercent + "% of the document");
This is the final part of my program code. The program lets you select a text file as well as a word and then shows various statistics like the total amount of words in the document, how many times your selected word shows up, etc. My problem is that I want it to show how much of a percentage of the document is made up from your selected word. I am using "int wordpercent = ((count/totalwords)*100); to show that. However, when I run the program everything works perfectly, except for this. It shows up as 0, which doesn't make sense to me since the count and totalwords variables are showing up correctly and are never 0.