salvin francis wrote:even if you don't want the method to be case-sensitive ...
why are both the calls to "toUpperCase" within a loop ?
Junilu Lacar wrote:Better yet, realize that what you have there is a conversion formula and that sort of thing might be better represented as a function/method, like so:
This also shows that the names you have used, g and Kg, suggest you have used the wrong formula. When converting kilos to grams, you should expect a larger number, not a smaller one.
Peter Liang wrote:Hi,