Your objective is to use a structure to model a 2D or 3D figure.
The purpose of this exercise is to build your understanding of how to use stored properties and computed properties.
Requirements
- Create an Xcode playground named GeometricFigures
- For your assigned 2D or 3D figure , you:
- perform manual calculations for at least one example of your figure on paper
- take a clear photograph or screenshot of those calculations and include that in your portfolio post for this exercise on Notion
- author a structure in code that will store key measurement(s)
- author a structure that computes:
- the area and perimeter (for 2D figures), or…
- the surface area and volume (for 3D figures)
- where applicable, other measurements (for example, a circle with a radius of 5 units could compute it’s diameter as 10 units)
- please write code that adheres to established code style conventions
- be sure to create instance(s) of the structure in the Xcode playground to verify that your code produces the same results as your calculations made on paper
Exemplar
Mr. Gordon was assigned the circle for this task.
Here are his manual calculations:

Here is his code written in an Xcode playground:

In Mr. Gordon’s portfolio post, he shared both of these screenshots and briefly summarized his understanding of what a computed property is and why it is useful.