Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
softservedata
* @softservedata
29 changes: 29 additions & 0 deletions FlowerBed.java
Original file line number Diff line number Diff line change
@@ -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();
}

}
Loading