...

/

Exercise: Calculate Shape Area

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:

Access this course and 1400+ top-rated courses and projects.