Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27233

VS 2010 Array / Function Help

$
0
0
Hi,
I'm somewhat new to programming so I'm just doing little questions I find on this internet, this one is working with arrays etc and I have looked at tutorials however I still can't manage to work this out:

Construct a program which asks a user for a sweet name. Search for it in the array. Display the position in the array. If the sweet is not found, it should display a message saying so. Test your program with sweets which exist within it and sweets who do not. Use a function to search.


Code:

Module Module1

    Sub Main()

        Dim arrSweets(5)

        arrSweets(0) = "Mars"
        arrSweets(1) = "Skittles"
        arrSweets(2) = "Galaxy"
        arrSweets(3) = "Starburst"
        arrSweets(4) = "Malteasers"
        arrSweets(5) = "Twirl"

        Console.WriteLine("Search For A Sweet")
        Dim Search As String = Console.ReadLine()

        Console.ReadLine()
    End Sub

End Module

Any help would be much appriciated.
Thanks a lot!

Viewing all articles
Browse latest Browse all 27233

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>