试图计算 5 件商品、3 家商店的总销售额。这是我得到的内容以及我的代码。我错过了什么/做错了什么?(ps它没有在“调试”中返回错误代码)
Public Class Form1
Private Sub btnCalc_Click(sender As Object, e As EventArgs) Handles btnCalc.Click
Dim ttlsales As Double
'set up array data
Dim sales(,) As Integer = {{25, 64, 23, 45, 14},
{12, 82, 19, 34, 63},
{54, 22, 17, 43, 35}}
Dim price() As Double = {12.0, 17.95, 95.0, 86.5, 78.0}
'mark totals
Dim totals(2) As Double
For store As Integer = 0 To 2
For item As Integer = 0 To 4
Next
Next
'display output
lstOut.Items.Add("Sales Per Store")
For store As Integer = 0 To 2
lstOut.Items.Add(store + 1 & ":" &
FormatCurrency(totals(store)))
ttlsales += totals(store)
Next
lstOut.Items.Add("Total Sales: " &
FormatCurrency(ttlsales))
End Sub
End Class