C# help CS0103
I followed directions can someone tell me what i did wrong
int[] salesValues = { 1000, 1500, 1800, 2600, 2500, 900 };
int runningTotal = 0;
// Clear the ListBox for each calculation
lstSales.Items.Clear();
// Calculate and display running total
foreach (var value in salesValues)
{
runningTotal += value;
lstSales.Items.Add($"Running Total: {runningTotal}");
}
5 Replies
lstSales
variable doesn't exist anywherehow do i fix it my proffesor didnt add it in the code?
@ZZZZZZZZZZZZZZZZZZZZZZZZZ
¯\_(ツ)_/¯
My bet is that some control in your form should be named
lstSales
aww thanks might have to email him
most likely that
listBox1