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...
Every time you till, you lose 30% of your organic matter. But this tiny ad is durable:
Two software engineers solve most of the world's problems in one K&R sized bookhttps://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton