watermath.vb

来自「Programming the .NET Compact Framework w」· VB 代码 · 共 35 行

VB
35
字号
Namespace YaoDurant.CFBook.Utilities

   Public Class WaterMath

      '  Constants
      Private Const GALLONS_PER_FOOT As Double = 7.48
      Private Const INCHES_PER_FOOT As Integer = 12

      Public Shared Function _
               GetVolume(ByVal dblSquareFeet As Double _
                         ) _
                         As Integer
         '  This version of GetVolume 
         '     assumes 1 inch of rain.
         Return dblSquareFeet * GALLONS_PER_FOOT _
                              / INCHES_PER_FOOT
      End Function

      Public Shared Function _
               GetVolume(ByVal dblSquareFeet As Double, _
                         ByVal intInches As Integer _
                         ) _
                         As Integer
         '  This version of GetVolume 
         '     accepts both roof size and rainfall.
         Return dblSquareFeet * GALLONS_PER_FOOT * intInches _
                              / INCHES_PER_FOOT
      End Function

   End Class

End Namespace


⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?