home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 40 / IOPROG_40.ISO / SOFT / NETFrameworkSDK.exe / comsdk.cab / samples.exe / Bank / RateSvr / RateLookup.cls next >
Encoding:
Visual Basic class definition  |  2000-06-23  |  2.0 KB  |  92 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4.   Persistable = 0  'NotPersistable
  5.   DataBindingBehavior = 0  'vbNone
  6.   DataSourceBehavior  = 0  'vbNone
  7.   MTSTransactionMode  = 0  'NotAnMTSObject
  8. END
  9. Attribute VB_Name = "RateLookup"
  10. Attribute VB_GlobalNameSpace = False
  11. Attribute VB_Creatable = True
  12. Attribute VB_PredeclaredId = False
  13. Attribute VB_Exposed = True
  14. '===========================================================================
  15. '  File:      RateLookup.cls
  16. '
  17. '  Summary:   This is the file that implements the loan rate method
  18. '
  19. '----------------------------------------------------------------------------
  20. '  This file is part of the Microsoft NGWS Samples.
  21. '
  22. '  Copyright (C) 1998-2000 Microsoft Corporation.  All rights reserved.
  23. '============================================================================
  24.  
  25.  
  26. Dim Rate(20) As Double
  27. Dim Term(20) As Integer
  28.  
  29.  
  30. Function GetLoanRate(ByVal LoanAmt As Double, ByVal LoanTerm As Integer) As Double
  31.     InitRates
  32.     
  33.     Dim R As Double
  34.     
  35.     i = 1
  36.     While LoanTerm >= Term(i)
  37.         i = i + 1
  38.     Wend
  39.         
  40.     R = Rate(i - 1)
  41.     
  42.     If LoanAmt > 230000 Then R = R + 0.5
  43.     
  44.     GetLoanRate = R
  45.     
  46. End Function
  47.  
  48. Private Sub InitRates()
  49.     Term(1) = 6
  50.     Term(2) = 12
  51.     Term(3) = 24
  52.     Term(4) = 30
  53.     Term(5) = 36
  54.     Term(6) = 42
  55.     Term(7) = 48
  56.     Term(8) = 54
  57.     Term(9) = 60
  58.     Term(10) = 66
  59.     Term(11) = 72
  60.     Term(12) = 78
  61.     Term(13) = 84
  62.     Term(14) = 90
  63.     Term(15) = 96
  64.     Term(16) = 180
  65.     Term(17) = 240
  66.     Term(18) = 300
  67.     Term(19) = 360
  68.     Term(20) = 999
  69.     
  70.      
  71.     Rate(1) = 2.4
  72.     Rate(2) = 2.8
  73.     Rate(3) = 3.6
  74.     Rate(4) = 4.25
  75.     Rate(5) = 4.8
  76.     Rate(6) = 6.34
  77.     Rate(7) = 6.9
  78.     Rate(8) = 7.25
  79.     Rate(9) = 7.8
  80.     Rate(10) = 8#
  81.     Rate(11) = 8#
  82.     Rate(12) = 8.5
  83.     Rate(13) = 8.5
  84.     Rate(14) = 9.15
  85.     Rate(15) = 9.5
  86.     Rate(16) = 7.8
  87.     Rate(17) = 8.35
  88.     Rate(18) = 8.45
  89.     Rate(19) = 8.55
  90.     Rate(20) = 999
  91. End Sub
  92.