VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "Bond"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit
Public stockName As String
Public investment As Single
Public invDate As Date
Public rate As Single

Public Function getName() As String
  getName = stockName
End Function

Public Function getTaxable(toDate As Date) As Single
  getTaxable = 0
End Function

Public Function getValue(toDate As Date) As Single
  Dim diff, value As Single

  diff = DateDiff("d", invDate, toDate)
  value = (diff / 365) * rate * investment + investment
  getValue = value
End Function

Public Sub init(nm As String)
  stockName = nm
  rate = 0.05
End Sub

Public Sub invest(amt As Single)
  invDate = CVDate(Date$)
  investment = amt
End Sub

Public Function isBond() As Boolean
  isBond = True
End Function
