Question: Both challanges in swift code please . . . enum ShapeDimensions { / / Square's associated value is the length of one side case Square
Both challanges in swift code please
enum ShapeDimensions
Square's associated value is the length of one side
case SquareDouble
Rectangle's associated value defines its width and height
case Rectanglewidth: Double, height: Double
func area Double
switch self
case let Squareside:
return side side
case let Rectanglewidth: w height: h:
return w h
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
