We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1ffd41f commit 144b71fCopy full SHA for 144b71f
FlowerBed.java
@@ -0,0 +1,28 @@
1
+import java.util.Scanner;
2
+
3
+/**
4
+ * Flower bed is shaped like a circle.
5
+ * Calculate its perimeter and area.
6
+ * Input the radius from the console, and output obtained results.
7
+ */
8
+public class FlowerBed {
9
10
+ public static void main(String[] args) {
11
12
+ Scanner scanner = new Scanner(System.in);
13
14
+ System.out.print("Input radius of flower bed, meters: ");
15
+ double radius = scanner.nextDouble();
16
17
+ double perimeter, area;
18
19
+ perimeter = 2 * Math.PI * radius;
20
+ area = Math.PI * Math.pow(radius, 2);
21
22
+ System.out.println("Perimeter of flower bed is " + perimeter + " m");
23
+ System.out.println("Area of flower bed is " + area + " m^2");
24
25
+ scanner.close();
26
+ }
27
28
+}
0 commit comments