Shape Area (Polymorphism)

HardGrade 12

Complete the GetArea overrides for TCircle and TRectangle so the polymorphic call in the main block 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.pas is the entry point. Add extra units for OOP exercises — they compile together.

Main.pas
Loading...

Run your code to see test results here.