Exercise: Calculate Shape Area

Learn to model different shapes with Ruby classes.

We'll cover the following

Calculate shape area

Define four classes, Shape, Rectangle, Triangle, and Square. Define the area method and attributes in these classes to calculate the shape area. With the class definitions provided by you, we should be able to create objects and calculate area as specified below:

Get hands-on with 1400+ tech skills courses.