I have been trying to figure out a problem for one of my assignments and I got completely stuck. I need to make a program that asks a user for 6 names. After the final name gets entered the program should display 2 names in alphabetical order the highest first the lowest second. Here is what I got so far:
Code:
Module Module1
Const MAX_Names = 6
Sub Main()
Dim name, highName, lowName As String
Dim count As Integer
count = 0
Console.WriteLine("Enter the name: ")
name = Console.ReadLine()
Do While count = MAX_Names
If name < lowName Then
lowName = name
ElseIf name > highName Then
highName = name
End If
Loop
Console.WriteLine("Low name is: " & lowName)
Console.WriteLine("Low name is: " & highName)
End Sub
End Module
If you can help me out or at least point me in a right direction I would really appreciate it. Thank you.