Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class Member
- Private _Name As String
- Private _Surname As String
- Private _Age As Integer
- Private _DOB As Date
- Private _Address As String
- Private _IDNum As String
- Private _Username As String
- Private _Password As String
- Private _Voted As Boolean
- Private _VoteName As String
- Public Shared _WeeklyContAmount As Double 'Actual Contribution amount required
- Public Shared IntRate As Double 'stores interest rate. I don't have access to the interest rate so I created this variable.
- Private _NonCont As Boolean
- Private _ContOwe As Double
- Private _TotalCont As Double
- Private _SumBorrow As Double
- Private _DateBorrow As Date
- Private _interest As Integer
- Private _Paid As Boolean
- Private _DatePaid As Date
- Public Property Name As String
- Get
- Return _Name
- End Get
- Set(value As String)
- _Name = value
- End Set
- End Property
- Public Property Surname As String
- Get
- Return _Surname
- End Get
- Set(value As String)
- _Surname = value
- End Set
- End Property
- Public Property Age As Integer
- Get
- Return _Age
- End Get
- Set(value As Integer)
- _Age = value
- End Set
- End Property
- Public Property DOB As Date
- Get
- Return _DOB
- End Get
- Set(value As Date)
- _DOB = value
- End Set
- End Property
- Public Property Address As String
- Get
- Return _Address
- End Get
- Set(value As String)
- _Address = value
- End Set
- End Property
- Public Sub Member(ByVal ID As String) 'ID=IDnum
- _IDNum = ID
- End Sub
- Public WriteOnly Property IDNum As String
- Set(value As String)
- '' Tenille, I am unsure about the validation here; please check with Nardus.
- If _IDNum.Length = 13 Then
- _IDNum = value
- Else
- _IDNum = 0
- End If
- End Set
- End Property
- Public Property Username() As String
- Get
- Return _Username
- End Get
- Set(value As String)
- _Username = value
- End Set
- End Property
- Public Property Password() As String
- Get
- Return _Password
- End Get
- Set(value As String)
- _Password = value
- End Set
- End Property
- Public Property Voted() As Boolean
- Get
- Return _Voted
- End Get
- Set(value As Boolean)
- _Voted = value
- End Set
- End Property
- Public Property VoteName() As String
- Get
- Return _VoteName
- End Get
- Set(value As String)
- _VoteName = value
- End Set
- End Property
- Public Property NonCont As Boolean
- Get
- Return _NonCont
- End Get
- Set(value As Boolean)
- _NonCont = value
- End Set
- End Property
- Public Property ContOwe As Double
- Get
- Return _ContOwe
- End Get
- Set(value As Double)
- _ContOwe = value
- End Set
- End Property
- Public Property TotalCont As Double
- Get
- Return _TotalCont
- End Get
- Set(value As Double)
- _TotalCont = value
- End Set
- End Property
- Public Property SumBorrow As Double
- Get
- Return _SumBorrow
- End Get
- Set(value As Double)
- _SumBorrow = value
- End Set
- End Property
- Public Property DateBorrow As Date
- Get
- Return _DateBorrow
- End Get
- Set(value As Date)
- _DateBorrow = value
- End Set
- End Property
- Public Property Interest As Integer
- Get
- Return _interest
- End Get
- Set(value As Integer)
- _interest = value
- End Set
- End Property
- Public Property Paid As Boolean
- Get
- Return _Paid
- End Get
- Set(value As Boolean)
- _Paid = value
- End Set
- End Property
- Public Property DatePaid As Date
- Get
- Return _DatePaid
- End Get
- Set(value As Date)
- _DatePaid = value
- End Set
- End Property
- Public Function CheckVoted() As Boolean
- If VoteName.Length = 0 Then 'Checks that there is something voted for.
- Voted = False ''Not sure how we'd check if it matches the charities nominated.
- Else
- Voted = True
- End If
- Return Voted
- End Function
- Public Function CalcAge() As Integer
- Age = CInt(Date.Today.Year - DOB.Year) 'Calculates the member's age using their DOB
- Return Age
- End Function
- Public Function CalcContOwed() As Double
- If NonCont = False Then 'Checks if they've Contributed. Note: this is working on the assumption that Noncont=true means they haven't paid
- ContOwe += 0
- Else
- ContOwe += _WeeklyContAmount 'if not contributed then add to their Contributions owed amount
- End If
- Return ContOwe
- End Function
- Public Function CalcTotalCont() As Double
- If NonCont = False Then
- TotalCont += _WeeklyContAmount 'Adds to their Total if they've Contributed.
- Else
- TotalCont = TotalCont 'returns existing total if they haven't contributed
- End If
- Return TotalCont
- End Function
- Public Function CalcInterest() As Integer
- Dim nWeeksBorrowed As Integer = DateDiff("ww", DateBorrow, DatePaid) 'counts the number of weeks between borrowed and paid dates
- Interest = Math.Ceiling((1 + (nWeeksBorrowed / 52) * IntRate))
- Return Interest
- End Function
- ''Nardus, I think I've covered all the calculations. Please tell me if anything must be added. You may need to send it back to Wasim for validation.
- '' Comments with 2 apostrophes in front can be removed.
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement