Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class Calculator
- Dim RateHour As Decimal
- Dim HourDay As Decimal
- Dim NumberOfDaysWork As Integer
- ' Constructor to pass the user-input values to the current instance
- ' `Dim Calc As New Calculator(blah blah, buh, baaaaaaaah)`
- Public Sub New(ByVal RH As Decimal, ByVal HD As Decimal, ByVal NDW As Integer)
- RateHour = RH
- HourDay = HD
- NumberOfDaysWork = NDW
- End Sub
- Public Function GetGrossSalary()
- Return (RateHour * HourDay) * NumberOfDaysWork
- End Function
- ' Percentage: TMW, PH, or SSS
- ' Abbreviations explained below
- Public Function GetDeduction(ByVal Percentage As Decimal)
- Return GetGrossSalary() * Percentage
- End Function
- ' TMW = Tax of Monthly Wages
- ' PH = PhilHealth
- ' SSS = Social Security System
- ' Summation of calculated deductions
- Public Function GetTotalDeduction(ByVal TMW As Decimal, ByVal PH As Decimal, ByVal SSS As Decimal)
- Return TMW + PH + SSS
- End Function
- Public Function GetNetSalary(ByVal TMW As Decimal, ByVal PH As Decimal, ByVal SSS As Decimal)
- Return GetGrossSalary() - GetTotalDeduction(TMW, PH, SSS)
- End Function
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement