Mini-exercises

  1. Create a protocol Area that defines a read-only property area of type Double.
  2. Implement Area with structs representing Square, Triangle, and Circle.
  3. Add a circle, a square, and a triangle to an array. Convert the array of shapes to an array of areas using map.

results matching ""

    No results matching ""