Announcement
Collapse
No announcement yet.
Need help on a Visual Basic programming problem
Collapse
X
-
No real programmers work in VB
AFK
Cocoa, Java, Ruby on Rails, and C# for win ttyl
Leave a comment:
-
programming sucks
learned enough to get through my matlab and mechatronics classes
screw that
though matlab was ok since that was actually useful.
Leave a comment:
-
Public Function MaxValOfIntArray(ByRef TheArray As Variant) As Integer
'This function gives max value of int array without sorting an array
Dim i As Integer
Dim MaxIntegersIndex As Integer
MaxIntegersIndex = 0
For i = 1 To UBound(TheArray)
If TheArray(i) > TheArray(MaxIntegersIndex) Then
MaxIntegersIndex = i
End If
Next
'index of max value is MaxValOfIntArray
MaxValOfIntArray = TheArray(MaxIntegersIndex)
End Function
Leave a comment:
-
The semesters already over with, I graduated! Woot!
Anyways, I just needed to turn this in for extra credit for an exam. Though, I aced the exam so I didn't really need this.
Thanks for the help guys! :wub:
P.s. My O.C.D. will probably allow me to work on this some more later, so if you wanna help spice this program up with me, by all means, go for it.
Leave a comment:
-
Lol you assholes acting like you've never asked for help before. I can't remember exactly stylez but I still have my book from when I took this, I'll try to refresh my memory
Leave a comment:
-
It's rather easy, but I am not helping you with your homework...
However if this is for anything but your homework, please tell me what it's for, and I might help you...
Leave a comment:
-
Public Class Form1
Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
Me.Close()
End Sub
Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click
lblOne.Text = String.Empty
Label3.Text = String.Empty
Label4.Text = String.Empty
End Sub
Private Sub btnInput_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnInput.Click
Dim strInput As String
Dim intValues(9) As Integer
Do
strInput = InputBox("Enter 10 values (comma separated) in the field below:")
If strInput = "" Then Exit Sub
Dim stringvalues() As String = strInput.Split(New Char() {","c}, StringSplitOptions.RemoveEmptyEntries)
If stringvalues.Length <> 10 Then
MsgBox("Enter exactly 10 numbers.")
Continue Do
End If
For x As Integer = 0 To stringvalues.Length - 1
If Not Integer.TryParse(stringvalues(x), intValues(x)) Then
MsgBox("Enter valid integer numbers.")
Continue Do
End If
Next
Exit Do
Loop
Label3.Text = intValues.Max.ToString
Label4.Text = intValues.Min.ToString
End Sub
Private Sub btnDisplay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDisplay.Click
' I'll finish this part up later.
End Sub
End Class
Leave a comment:
-
Can I see what code you have so far? No point in starting from scratch.
-24
Leave a comment:
-
Does visual basic have a sorting feature or do you have to code one in? Sorting 10 values isn't hard so it's easy either way.
Leave a comment:
Channels
Collapse

Leave a comment: