Previous Next
0 / 15
Module DEMO-33-71DEMO-OOP-33

Circle Math Preview

DEMO-OOP-33 โ€ข Object Oriented Programming

Browser-only practice

Problem Statement

Create Main.java and CirclePreview.java. Use the Math API to print a circle summary.

Input Format

Input is given as whitespace-separated tokens in this order:

  1. circle radius

Output Format

Print the exact report in this order:

  1. Area
  2. Circumference

Sample Testcases

Submit runs every public testcase in this browser. Results and code never leave this device.

Sample #1
Public sample
2.0
Area: 12.57
Circumference: 12.57
Input: circle radius = 2.0.
Key calculation(s): area = Math.PI * 2.0 * 2.0 | circumference = 2 * Math.PI * 2.0 | "Area: " + String.format("%.2f", area) = "Area: 12.57".
Output:
Area: 12.57
Circumference: 12.57
Sample #2
Public sample
3.5
Area: 38.48
Circumference: 21.99
Input: circle radius = 3.5.
Key calculation(s): area = Math.PI * 3.5 * 3.5 | circumference = 2 * Math.PI * 3.5 | "Area: " + String.format("%.2f", area) = "Area: 38.48".
Output:
Area: 38.48
Circumference: 21.99

Web terminal

C, C++, Java, and Python run locally in a browser VM. No worker or visualizer is used.

Saved in this browser
Editor settings