-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFindArea.java
More file actions
38 lines (31 loc) · 1.23 KB
/
FindArea.java
File metadata and controls
38 lines (31 loc) · 1.23 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
import java.util.Scanner;
public class FindArea{
public static void main(String[]args){
Scanner scn = new Scanner(System.in);
// Area of the Triangle:
// System.out.println("Enter your number to find Area of Triangle!");
// System.out.println("Enter your Base Number:");
// double base = scn.nextDouble();
// System.out.println("Enter your height Number:");
// double height = scn.nextDouble();
// double araeTrg = 0.5 * base * height;
// System.out.println("Your Area of Triangle is:"+araeTrg);
// Area of Square:
// System.out.println("Enter your area:");
// int area = scn.nextInt();
// int areaSqr = area * area;
// System.out.println("Your Area of Square is:"+areaSqr);
// Area of Rectangle:
// System.out.println("Enter your Width:");
// double width = scn.nextDouble();
// System.out.println("Enter your length:");
// double length = scn.nextDouble();
// double areaRect = width * length;
// System.out.println("your Area of Rectangle is:"+areaRect);
// Area of Circle:
System.out.println("Enter your Radius:");
double radius = scn.nextDouble();
double areaCir = 3.14 * (radius * radius);
System.out.println("Your Area of Circle is:"+areaCir);
}
}