I am trying to teach myself java and I have a book but it doesnt have how to parse an int into a string. So are there any ways of either doing this or getting round it so I can display my answer? I put in bold the place where the difficulty is. Once I have got this done I can put it on JPanels etc. I am trying to have a goal achieve it and then have another goal with the same programme. Also if you have any tips of teaching yourself java I would be interested to know.
import javax.swing.*;
class percentbible
{
public static void Main (String[]args)
{
String a;
//enter in number for a string
a=JOptionPane.showInputDialog(null,"enter chapters of bible read","",JOptionPane.INFORMATION_MESSAGE);
//turn string into number
int num = Integer.parseInt(a);
int chapno = 1189;
int calc= num/chapno*100;
String show;
//convert integer into string
[B] show = String.parseString(calc);[/B]
//display calculation
show= JOptionPane.showMessageDialog(null,"percentage of chapters read","",JOptionPane.INFORMATION_MESSAGE);
}
}