Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

Java , Parse Double to user string input?

As you can see there is an error on line 30. It says flip operands of '*' . Does not make much sense why it would say that , but I believe my problem is that I need to parse the user input to double so that I can return total to my main method. How can I do this?

Attachment image

3 Answers

Relevance
  • 6 years ago
    Favorite Answer

    Hi jason h. On line 29, input is a String. So line 30 needs to read like this:

    total = hourlyRate * Double.parseDouble(input);

  • 6 years ago

    thanks I figured it out before you responded :P

  • Anonymous
    6 years ago

    :)

Still have questions? Get your answers by asking now.