Guest User

Untitled

a guest
Dec 14th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. public class Cone {
  2.  
  3. //instance variables
  4. private static int Height;
  5. private static int Radius;
  6.  
  7. public Cone(int iniHeight, int iniRadius){ //constructors
  8.  
  9. Height = iniHeight;
  10. Radius = iniRadius;
  11.  
  12. iniHeight = 0;
  13. iniRadius = 0;
  14. }
  15. //public methods go here.
  16.  
  17. public Cone() {
  18. // TODO Auto-generated constructor stub
  19. }
  20.  
  21. public static double getsRadius() {
  22. return Radius;
  23. }
  24. public static double getsHeight() {
  25. return Height;
  26. }
  27. public static double getsSlantHeight() {
  28. return Math.sqrt((Radius*Radius)+(Height*Height));
  29. }
  30. public static double getsVolume() {
  31. return (1/3*Math.PI*(Radius*Radius)*Height);
  32. }
  33. public static double getsSurfaceArea() { //=piRS + PiR2rd.
  34. return Math.PI*Radius*(Math.sqrt((Radius*Radius)+(Height*Height))+(Math.PI*(Radius*Radius)));
  35. }
  36. public static double getsBaseArea() {
  37. return Math.PI*(Radius*Radius);
  38. }
  39. public void raiseHeight(double byPercentage) {
  40.  
  41. }
  42. void raiseRadius(double byPercentage){
  43.  
  44. }
  45. }//close main method
Add Comment
Please, Sign In to add comment