How to do it...

  1. Create a method called GetShopfloorSpace() that takes three parameters: for the common area space, the building width, and the building length.
        public Building GetShopfloorSpace(int floorCommonArea,                         int buildingWidth, int buildingLength)        {        }
  1. We are returning a Building type, so create a class called Building that has a single property called TotalShopFloorSpace.
        public class Building        {           public int TotalShopFloorSpace { get; set; }         }
  1. Our local function will simply take the width and length of the building to calculate the total floor area and then subtract the common area from that to get the usable floor space for shops. The local function will look as follows:
 int CalculateShopFloorSpace(int common, int width, ...

Get C# 7 and .NET Core Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.