Skip to content

Instantly share code, notes, and snippets.

@jasongorman
Last active April 3, 2019 07:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasongorman/cbf6a122940acbae7c01a3d14f0566f5 to your computer and use it in GitHub Desktop.
Save jasongorman/cbf6a122940acbae7c01a3d14f0566f5 to your computer and use it in GitHub Desktop.
Option Explicit
Public Function Quote(ByRef room As Room, ByRef carpet As Carpet) As Double
Quote = Price(carpet, Area(room))
End Function
Public Function Area(ByRef room As Room)
Area = room.Width * room.Length
End Function
Public Function Price(ByRef carpet As Carpet, ByVal area As Double)
If carpet.RoundUp Then
area = Ceiling(area)
End If
Price = carpet.PricePerSqMtr * area
End Function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment