diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index c600428c..dfb37968 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -softservedata +* @softservedata \ No newline at end of file diff --git a/FlowerBed.java b/FlowerBed.java new file mode 100644 index 00000000..aa9b0ae3 --- /dev/null +++ b/FlowerBed.java @@ -0,0 +1,29 @@ +import java.util.Scanner; + + +/** + * Flower bed is shaped like a circle. + * Calculate its perimeter and area. + * Input the radius from the console, and output obtained results. + */ +public class FlowerBed { + + public static void main(String[] args) { + + Scanner scanner = new Scanner(System.in); + + System.out.print("Input radius of flower bed, meters: "); + double radius = scanner.nextDouble(); + + double perimeter, area; + + perimeter = 2 * Math.PI * radius; + area = Math.PI * Math.pow(radius, 2); + + System.out.println("Perimeter of flower bed is " + perimeter + " m"); + System.out.println("Area of flower bed is " + area + " m^2"); + + scanner.close(); + } + +}