Advertisement
Guest User

VBMatrix

a guest
Jan 21st, 2013
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Private Sub IncomeButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles IncomeButton.Click
  2.         ' Write the code to multiply the sales by the prices to find the income
  3.        Dim row As Integer
  4.         Dim column As Integer
  5.         For row = 0 To 4
  6.             income(row) = 0 'This is the bugfix. It resets the value before calculating because else you're adding up what was already there and the new values, which is not what you want.
  7.            For column = 0 To 2
  8.                 income(row) = income(row) + (sales(row, column) * prices(column))
  9.             Next
  10.         Next
  11.         DisplayIncome()
  12.     End Sub
  13. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement