BirdofPrey
02-01-2008, 07:28 PM
Because I am Stuck. (if you can't tell form the presence of the UNIX thread I am NOT haing a good time.
My file won't compile andthe error I get is
Calc.java:28: incompatible types
found : double
required: java.lang.Double
radius = Double.parseDouble (inputLine);
^
Calc.java:29: operator * cannot be applied to double,java.lang.Double
volume = 4 / 3 * Math.PI * radius *radius * radius;
^
Calc.java:30: operator * cannot be applied to double,java.lang.Double
surfaceArea = 4 * Math.PI * radius * radius;
^
inputLine is a string and radius is a floating point number.
I am trying to convert text input to a number to calculate the surface area an volume of a sphere hen output the results
My file won't compile andthe error I get is
Calc.java:28: incompatible types
found : double
required: java.lang.Double
radius = Double.parseDouble (inputLine);
^
Calc.java:29: operator * cannot be applied to double,java.lang.Double
volume = 4 / 3 * Math.PI * radius *radius * radius;
^
Calc.java:30: operator * cannot be applied to double,java.lang.Double
surfaceArea = 4 * Math.PI * radius * radius;
^
inputLine is a string and radius is a floating point number.
I am trying to convert text input to a number to calculate the surface area an volume of a sphere hen output the results