Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I am trying to get display the highest number from the second column. I have trying different combination of code but I dont get the highest number.

what can be a way to display the highest number for the second colum?

 

here is the array:

 

Dim intScores(,) As Integer = {{89, 98}, _

{78, 45}, _

{67, 89}, _

{90, 99}, _

{91, 70}, _

  • *Experts*
Posted

Since this sounds like a homework assignment...

Can you show us what code you've tried? Do you need help looping through the array, finding the max value, or displaying a value (display it *where*)? As you can see, there are many possible questions that need answering...

 

-nerseus

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Posted (edited)
Since this sounds like a homework assignment...

Can you show us what code you've tried? Do you need help looping through the array, finding the max value, or displaying a value (display it *where*)? As you can see, there are many possible questions that need answering...

 

-nerseus

 

Well my problem was to find the number inside the column of the array

I was looping thought the array but was getting the wrong number. I also had it that when I was looping it was only getting the first number in the array and it was not going thought the array. So I tried this and place the value inside the label.

 

For intHighRow = 0 To 5

'Search the array for the second column to find the higest number.

If intScores(intHighRow, 1) > 98 Then

Me.FinalLabel.Text = intScores(intHighRow, 1)

Else

intHighCount = intHighCount + 1

 

If intScores(intHighCount, 1) > 98 Then

Me.FinalLabel.Text = intScores(intHighCount, 1)

End If

End If

Next intHighRow

Edited by alexoval

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...