-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMin.java
More file actions
28 lines (20 loc) · 698 Bytes
/
Copy pathMin.java
File metadata and controls
28 lines (20 loc) · 698 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
import java.util.Scanner;
public class Min {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int ch = in.nextInt();
switch (ch) {
case 1:
Rectangle r = new Rectangle(in.nextDouble(),in.nextDouble());
double area = r.calculateleArea();
System.out.println(area);
break;
case 2:
Circle c = new Circle(in.nextDouble());
double Area = c.calculateleArea();
System.out.println(Area);
default:
break;
}
}
}