Challenge: Advancing the Shapes Analysis

This lesson brings you a challenge to solve.

We'll cover the following

Problem statement

Expand the same program given below, define a type Triangle, and let it implement AreaInterface. Test this by calculating the area of a specific triangle.

Area of a triangle = 0.5(baseheight)0.5 * (base * height)

Then, define a new interface PeriInterface, which defines a method Perimeter(). Let the type Square implement this interface and test it with our square value.

Try to solve the challenge below. Good Luck!

Get hands-on with 1200+ tech skills courses.