Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Cone {
- //instance variables
- private static int Height;
- private static int Radius;
- public Cone(int iniHeight, int iniRadius){ //constructors
- Height = iniHeight;
- Radius = iniRadius;
- iniHeight = 0;
- iniRadius = 0;
- }
- //public methods go here.
- public Cone() {
- // TODO Auto-generated constructor stub
- }
- public static double getsRadius() {
- return Radius;
- }
- public static double getsHeight() {
- return Height;
- }
- public static double getsSlantHeight() {
- return Math.sqrt((Radius*Radius)+(Height*Height));
- }
- public static double getsVolume() {
- return (1/3*Math.PI*(Radius*Radius)*Height);
- }
- public static double getsSurfaceArea() { //=piRS + PiR2rd.
- return Math.PI*Radius*(Math.sqrt((Radius*Radius)+(Height*Height))+(Math.PI*(Radius*Radius)));
- }
- public static double getsBaseArea() {
- return Math.PI*(Radius*Radius);
- }
- public void raiseHeight(double byPercentage) {
- }
- void raiseRadius(double byPercentage){
- }
- }//close main method
Add Comment
Please, Sign In to add comment