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 Math.pow issues?

I''m having issues with my program ignoring the Math.pow portion of my calculations.

Here's the line that is having the issues...

volume = (Math.pow(radius,3) * 4 * Math.PI) / 3;

I can't spot any obvious issues, but as I said my program seems just just replace the whole "Math.pow(radius, 3)" part with a 1 or something.

Update:

Anything. This part of the program is being used to find the volume of a sphere. It is given the Diameter by the user, divides that by 2 to get the radius, and then runs that through the line of code I showed above to get the volume. It is declared as a double.

2 Answers

Relevance
  • 1 decade ago
    Favorite Answer

    There is no issue with the code.

  • 1 decade ago

    what are the possible values of the variable "radius"?

Still have questions? Get your answers by asking now.