Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub IncomeButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles IncomeButton.Click
- ' Write the code to multiply the sales by the prices to find the income
- Dim row As Integer
- Dim column As Integer
- For row = 0 To 4
- 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.
- For column = 0 To 2
- income(row) = income(row) + (sales(row, column) * prices(column))
- Next
- Next
- DisplayIncome()
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement