-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
46 lines (41 loc) · 1.43 KB
/
Main.java
File metadata and controls
46 lines (41 loc) · 1.43 KB
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
38
39
40
41
42
43
44
45
46
/*
* 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;
import java.util.*;
/**
*
* @author Samim
*/
public class Main {
private static Cyclinder create(){
Scanner sc=new Scanner(System.in);
double r,h;
System.out.println("Enter Radius :");
r=sc.nextDouble();
System.out.println("Enter Height :");
h=sc.nextDouble();
Cyclinder obj=new Cyclinder();
obj.setRadius(r);
obj.setHieght(h);
return obj;
}
public static void Display(Cyclinder opt){
//Circle
System.out.println("Radius :"+opt.getRadius());
System.out.println("Diameter :"+opt.CalcDiameter());
System.out.println("Circumferace :"+opt.CalcCircumferance());
System.out.println("Circle Area :"+opt.CalcArea());
System.out.println("");
//Cyclinder
System.out.println("Height :"+opt.getHeight());
System.out.println("Lateral Area :"+opt.CalcLateralArea());
System.out.println("Total Area :"+opt.CalcTotalArea());
System.out.println("Voume :"+opt.CalcVolume());
}
public static void main(String args[]){
Cyclinder tube =create();
Display(tube);
}
}