# Thread: i am stuck an not sure what to do here calculations keep resulting in 0.0

1. Member
Join Date
Jul 2016
Posts
8
Rep Power
0

## i am stuck an not sure what to do here calculations keep resulting in 0.0

public class TurnerCylinder
{
public static class Cylinder extends
{
double height;
double area = (2 * Math.PI * radius * height) + (2 * Math.PI *(radius * radius));
double volume= height * Math.PI * radius * radius;
public Cylinder(double radius, double height)
{
this.height = height;
}
{
}
public void setRadius(double r)
{
}
public double getHeight()
{
return height;
}
public void setHeight(double h)
{
height = h;
}
public double getArea()
{
return area;
}
public double getVolume()
{
return volume;
}
public String toString()
{
return ("Cylinder radius is " + radius + " and the height is " + height + ". Cylinder Area is " + area + " and the volume is " + volume + ".");
}
}
public static void main (String [] args)
{

Cylinder cylinder1 = new Cylinder(5.5, 7.8);

System.out.println(cylinder1);
System.out.println(cylinder1);
cylinder1.setHeight(10.9);
System.out.println(cylinder1);
}

}

2. Member
Join Date
Jul 2016
Posts
8
Rep Power
0

## Re: i am stuck an not sure what to do here calculations keep resulting in 0.0

forget the first line where it says extends i didnt mean to have that there

3. ## Re: i am stuck an not sure what to do here calculations keep resulting in 0.0

Please edit your post and wrap your code with code tags:

[code]
**YOUR CODE GOES HERE**
[/code]

to get highlighting and preserve formatting.

Do you have a question?
If the there are errors, copy the full text and paste it here.
If the output is not what you want, copy the output, paste it here and add some comments saying what is wrong with it.

4. Member
Join Date
Jul 2016
Posts
8
Rep Power
0

## Re: i am stuck an not sure what to do here calculations keep resulting in 0.0

sorry new to posting on threads i actually figured it out thank you tho

5. ## Re: i am stuck an not sure what to do here calculations keep resulting in 0.0

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•