Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Sphere{
- private float redius;
- private float area;
- private float volume;
- public void setRedius(float temp){
- redius = temp;
- }
- public void calculateSurfaceArea(){
- area = (float) (4*3.14*(Math.pow(redius,2) ));
- }
- public void calculateVolume(){
- volume = (float)( (4*3.14*(Math.pow(redius,3)))/3 );
- }
- public float getArea(){
- return area;
- }
- public float getVolume(){
- return volume;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement