File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed
samueledward/Question 2.0 Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change
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
+ }
You can’t perform that action at this time.
0 commit comments