Skip to content

Commit dcd6b49

Browse files
committed
Issue 2.19 solved
1 parent 51b8a78 commit dcd6b49

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

samueledward/Question 2.0/Circle.java

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
* To change this license header, choose License Headers in Project Properties.
3+
* To change this template file, choose Tools | Templates
4+
* and open the template in the editor.
5+
*/
6+
package classes;
7+
8+
/**
9+
*
10+
* @author Samuel Edward
11+
*/
12+
13+
import java.util.Scanner;
14+
15+
public class Circle {
16+
public static void main (String args[]) {
17+
// Declaration of varriable
18+
int radius, diameter;
19+
double circumfrence, area;
20+
double PI = 3.14159;
21+
22+
// Getting varriable from the user
23+
Scanner sc = new Scanner(System.in);
24+
System.out.println("Enter the radius of a Circle: ");
25+
radius = sc.nextInt();
26+
27+
//Output Assignment
28+
diameter = 2 * radius;
29+
circumfrence = PI * radius * 2;
30+
area = PI * radius * radius;
31+
32+
//Printing all the requiered variable to the console
33+
System.out.println("The value for the diameter : " + diameter);
34+
System.out.println("The value for the circumfrence: " + circumfrence);
35+
System.out.println("The value for the area : " + area);
36+
37+
38+
39+
40+
41+
}
42+
43+
}

0 commit comments

Comments
 (0)