Advertisement
Guest User

Untitled

a guest
May 27th, 2015
267
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 0 0
  1. Sub Main()
  2.  
  3. ' Local variable declaration. This variable can be used in this subroutine only
  4. Dim personalIncome As Double
  5. Dim parentalIncome As Double
  6. Dim annualAllowance As Double
  7.  
  8. annualAllowance = 0
  9.  
  10. ' Call the inputRate inputAge subroutine
  11. Sub Second()
  12. inputAge()
  13. inputRate()
  14.  
  15. While age <> -1 Or rate <> "X"
  16. ' call the calcBaseAnnualAllowance subroutine
  17. calcBaseAnnualAllowance()
  18. If rate = "I" Then
  19. Console.Write("Personal Income ? ")
  20. personalIncome = Console.ReadLine()
  21. annualAllowance = baseAnnualAllowance - (personalIncome * 0.5)
  22. Else
  23. If rate = "S" Or rate = "A" Then
  24. Console.Write("Personal Income ? ")
  25. personalIncome = Console.ReadLine()
  26. Console.Write("Parental Income ? ")
  27. parentalIncome = Console.ReadLine()
  28. If parentalIncome > 50000 Then
  29. annualAllowance = baseAnnualAllowance - (personalIncome * 0.5) - ((parentalIncome - 50000) * 0.3)
  30. Else
  31. If parentalIncome < 50000 Then
  32. annualAllowance = baseAnnualAllowance - (personalIncome * 0.5)
  33. End If
  34. End If
  35. End If
  36. End If
  37.  
  38. ' Display the annualAllowance
  39. Console.WriteLine("Annual Allowance = " & annualAllowance)
  40.  
  41. ' Call the inputRate inputAge subroutine
  42.  
  43.  
  44. ' inputAge()
  45. ' inputRate()
  46.  
  47. End While
  48. End Sub Second
  49. Console.ReadLine()
  50.  
  51. End Sub Main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement