Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub Main()
- ' Local variable declaration. This variable can be used in this subroutine only
- Dim personalIncome As Double
- Dim parentalIncome As Double
- Dim annualAllowance As Double
- annualAllowance = 0
- ' Call the inputRate inputAge subroutine
- Sub Second()
- inputAge()
- inputRate()
- While age <> -1 Or rate <> "X"
- ' call the calcBaseAnnualAllowance subroutine
- calcBaseAnnualAllowance()
- If rate = "I" Then
- Console.Write("Personal Income ? ")
- personalIncome = Console.ReadLine()
- annualAllowance = baseAnnualAllowance - (personalIncome * 0.5)
- Else
- If rate = "S" Or rate = "A" Then
- Console.Write("Personal Income ? ")
- personalIncome = Console.ReadLine()
- Console.Write("Parental Income ? ")
- parentalIncome = Console.ReadLine()
- If parentalIncome > 50000 Then
- annualAllowance = baseAnnualAllowance - (personalIncome * 0.5) - ((parentalIncome - 50000) * 0.3)
- Else
- If parentalIncome < 50000 Then
- annualAllowance = baseAnnualAllowance - (personalIncome * 0.5)
- End If
- End If
- End If
- End If
- ' Display the annualAllowance
- Console.WriteLine("Annual Allowance = " & annualAllowance)
- ' Call the inputRate inputAge subroutine
- ' inputAge()
- ' inputRate()
- End While
- End Sub Second
- Console.ReadLine()
- End Sub Main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement