Classes and Objects • Exercise 3/3

Rectangle Class

00:00
0
20 points

Instructions

Create a Rectangle class with:

  • initialize(width, height)
  • width and height reader attributes
  • area method returning width * height
  • perimeter method returning 2 * (width + height)
  • square? method returning true if width equals height

Your Code

Results

Click "Run Tests" to see results