I hope this code has shown you some of the power of the switch block, with expression-bodied members now being used with properties and even constructors. Remember, this means that the following line is an expression-bodied member with a constructor:
public Circle(double r) => radius = r;
On the other hand, consider this line:
public double Radius { get => radius; }
This is an expression-bodied member with a property. We also looked at when you should use class and when you should use interface. Classes express the is a type of relationship, while interfaces are usually used to express the can be used as type of relationship. Hence, in the code, I have a Rectangle class because it is a kind of shape and Circle because it is also a kind of shape. I hope all of this makes sense to you.
In the next chapter, we'll expand our knowledge of switch blocks by looking...