watermath.cs

来自「windows mobile 开发实例wi ndows mobile 开发实例」· CS 代码 · 共 39 行

CS
39
字号
//-----------------------------------------------------------------------------
// Code from _Programming the .NET Compact Framework with C#_
// and _Programming the .NET Compact Framework with VB_
// (c) Copyright 2002-2004 Paul Yao and David Durant. 
// All rights reserved.
//-----------------------------------------------------------------------------

using System;

namespace YaoDurant.CFBook.Utilities
{
	/// <summary>
	/// Summary description for WaterMath.
	/// </summary>
	public class WaterMath
	{
      //  Constants
      private const double GALLONS_PER_FOOT = 7.48;
      private const int INCHES_PER_FOOT = 12;

      public static int GetVolume( double dblSquareFeet ) 
      {
         //  This version of GetVolume 
         //     assumes 1 inch of rain.
         return (int)(dblSquareFeet * 
            GALLONS_PER_FOOT / INCHES_PER_FOOT );
      }

      public static int GetVolume( double dblSquareFeet, 
         int intInches ) 
      {
         //  This version of GetVolume 
         //     accepts both roof size and rainfall.
         return (int)(dblSquareFeet * GALLONS_PER_FOOT * 
            intInches / INCHES_PER_FOOT);
      }
   }
}

⌨️ 快捷键说明

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