Ashley,
Here is a new and improved app. I created a function called GetAnnualPayIncrease. The function requires two parameters: AnnualPay and Rate. See code below:
You will see I made a loop that calls the function 10 times...hence a decade.Code:Ashley, Here is a new and improved app. I created a function called GetAnnualPayIncrease. The function requires two parameters: AnnualPay and Rate. See code below: Dim HourlyPay As Integer = CInt(txtEnterPay.Text) Dim Rate As Decimal = CDec(txtEnterRaise.Text) Dim annualSalary As Decimal = ((HourlyPay * 40) * 52) For yearNumber As Integer = 1 To 10 If yearNumber = 1 Then Me.lstYearlyPay.Items.Add("Year 1: " & annualSalary.ToString("C")) Else annualSalary += GetAnnualPayIncrease(annualSalary, Rate) Me.lstYearlyPay.Items.Add("Year " & yearNumber & ": " & annualSalary.ToString("C")) End If Next Private Function GetAnnualPayIncrease(ByVal AnnualPay As Decimal, ByVal Rate As Decimal) As Decimal Dim salaryIncrease As Decimal = AnnualPay * (Rate / 100) Return salaryIncrease End Function




Reply With Quote