home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2005 June (DVD) / DPPRO0605DVD.iso / dotNETSDK / SETUP.EXE / netfxsd1.cab / FL_math_vb________.3643236F_FC70_11D3_A536_0090278A1BB8 < prev    next >
Encoding:
Text File  |  2001-08-21  |  1.2 KB  |  35 lines

  1. ∩╗┐ '==========================================================================
  2. '  File:        math.vb
  3. '
  4. '==========================================================================
  5. Imports System
  6. <Assembly: System.Reflection.AssemblyVersion("1.0.0.0")>
  7. <Assembly: System.Reflection.AssemblyKeyFile("WorldCalcKey.snk")>
  8.  
  9.  
  10. Namespace Demo.Localize.Math
  11.     
  12.     
  13.     Public Class InvalidFormulaException
  14.         Inherits ApplicationException
  15.     End Class 'InvalidFormulaException
  16.      
  17.     Public Class IntegerMath
  18.         
  19.         Public Function GetResult(arg1 As Int32, op As [Char], arg2 As Int32) As [String]
  20.             Select Case op
  21.                 Case "+"c
  22.                         Return [String].Format("{0:###0}", arg1 + arg2)
  23.                 Case "-"c
  24.                         Return [String].Format("{0:###0}", arg1 - arg2)
  25.                 Case "/"c
  26.                         Return [String].Format("{0:###0}", arg1 \ arg2)
  27.                 Case "*"c
  28.                         Return [String].Format("{0:###0}", arg1 * arg2)
  29.                 Case Else
  30.                         Throw New InvalidFormulaException()
  31.             End Select
  32.         End Function 'GetResult
  33.     End Class 'IntegerMath 
  34. End Namespace 'Demo.Localize.Math
  35.