Vb

profileAdnn.u

I need the correct code to display all names who donated not repeating the same student name as shown in the attachment 

 

this is the code 

 

 For i = 0 To donationArray.Length - 1

            If donationArray(i) > 0 Then

                lstSummary.SelectedIndex = i

                lstSummary.Items.Add("Donation for " + lstStudents.SelectedItem(i) + "= $" + CStr(donationArray(i))) 'dispaying corresponding elemets in array and lst box

            End If

        Next

        'displaing item is the summary listbox

        lstSummary.Items.Add("")

        lstSummary.Items.Add(CStr(Average("count")) + " members have received  donations.")

        lstSummary.Items.Add(CStr(lstStudents.Items.Count() - (Average("count"))) + " members have not received any donations.")

        lstSummary.Items.Add("")

        lstSummary.Items.Add("Highest total for an individual is  $" + CStr(getMaxMinDonation("high")))

        lstSummary.Items.Add("Lowest total donation earned by a student is $" + CStr(getMaxMinDonation("low")))

        lstSummary.Items.Add("The average donation per student is $" + CStr(Average("total") / lstStudents.Items.Count))

 

    End Sub

 

I attached two picture one which is shows the error is the listbox repeating the smae student name and the other attachment its an example of how it shoud looks like

  • 11 years ago
  • 3
Answer(0)
Bids(0)