forked from BarkaBoss/Java-Full-Stack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOOPMain.java
More file actions
27 lines (22 loc) · 747 Bytes
/
Copy pathOOPMain.java
File metadata and controls
27 lines (22 loc) · 747 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
package oop;
import ui.GeometryUI;
import java.util.InputMismatchException;
import java.util.Scanner;
public class OOPMain {
public static void main(String[] args) {
Geometry geometry = new Geometry();
geometry.accessingPi();
GeometryUI ui = new GeometryUI();
ui.drawUI();
Scanner input = new Scanner(System.in);
try{
float length = input.nextFloat();
float breadth = input.nextFloat();
System.out.println(geometry.areaOfTriangle(breadth, length));
}catch (InputMismatchException ime){
System.out.println("Enter a valid number");
}catch (Exception e){
System.out.println("Something went wrong");
}
}
}