-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCyclinder.java
More file actions
37 lines (35 loc) · 868 Bytes
/
Cyclinder.java
File metadata and controls
37 lines (35 loc) · 868 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package Shape;
/**
*
* @author Samim
*/
public class Cyclinder extends Circle {
double height;
Cyclinder(){
height=0.0;
}
public double getHeight(){
return height;
}
public void setHieght(double value){
if(height<0){
height=0.0;
}
else{
height=value;
}
}
public double CalcLateralArea(){
return 2*radius*height*Math.PI;
}
public double CalcTotalArea(){
return 2*radius*(height+radius)*Math.PI;
}
public double CalcVolume(){
return Math.pow(radius,2)*height*Math.PI;
}
}