-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstatinstan.java
More file actions
36 lines (26 loc) · 742 Bytes
/
Copy pathstatinstan.java
File metadata and controls
36 lines (26 loc) · 742 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
import java.util.Scanner;
class statinstan
{
float rad;
static int square;
void calculateCircle()
{
System.out.println("Area of Circle" + (3.14*rad*rad));
}
static void calculateSquare(int n)
{
square = n * n;
System.out.println("Area of Square: " + square);
}
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
statinstan obj = new statinstan();
System.out.print("Enter a number: ");
obj.rad = sc.nextFloat();
System.out.print("Enter another number: ");
obj.square = sc.nextInt();
obj.calculateCircle();
statinstan.calculateSquare(obj.square);
}
}