That isn't the right question. I think you shouldn't be intercovnerting ints and Strings in the first place. Why go int→String→int? That is because you are not using objects. If you were using objects, you would have a Fraction class and you could create a Fraction object. If you go back to my code in my post on Friday morning, you can do this sort of thing...but the add() method returns a Fraction object.The toString() method of that Fraction object might return “1¼”.
Charlie Garc wrote:. . . Is this how I now convert my string back to an int so that I can reduce the fraction? . . .
Charlie Garc wrote:My assignment is to contain all of my code within the main method.. My next program will be to separate it out...
The first person to drink cow's milk. That started off as a dare from this tiny ad:
Programmatically Create PDF Using Free Spire.PDF with Javahttps://coderanch.com/wiki/703735/Programmatically-Create-PDF-Free-Spire