Shape Area (Polymorphism)

HardGrade 12

Complete the getArea() overrides for Circle and Rectangle so the polymorphic call in main() computes the correct area for whichever shape was created.

Input / Output

Input: line 1 is "circle" or "rectangle". If circle, line 2 is the radius. If rectangle, line 2 is "width height". Output: the area, formatted to 2 decimal places.

Examples

Input

circle
5

Expected Output

78.54

Input

rectangle
4 6

Expected Output

24.00

+ 2 hidden tests checked on Submit.

Files

Main.java is the entry point. Add extra classes for OOP exercises — they compile together.

Main.java
Loading...

Run your code to see test results here.