Quote:
Originally Posted by manny85
The reason I choose the Switch statement was mainly because I don't think that if a user inputs a letter that ".parseDouble" converts it to a numeric value. So my reasoning was that if they only guess letters they'll never succeed with that system. Please correct me if I'm wrong in that logic.[/url]
|
The Double.parseDouble function will convert a String to a double. However, you are correct in that floating-point numbers are inherently inexact and as such any comparisons involving a floating-point number is likely to yield incorrect results.