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

VS 2010 [RESOLVED] Case Statements

$
0
0
Hi, I'm trying to practice programs with little programs and I'm trying to make a program which would distunguish if the user is a Child, Teenager or Adult:
This is what I've written but it doesn't seem to be working

Code:

Module Module1

    Sub Main()

        Console.WriteLine("Enter Your Age: ")
        Dim Age As Integer = Console.ReadLine

        If Age = 0 - 12 Then
            Console.WriteLine("Child")
        ElseIf Age = 13 - 19 Then
            Console.WriteLine("Teenager")
        ElseIf Age = 20 - 100 Then
            Console.WriteLine("Adult")
        End If
        Console.ReadLine()
    End Sub

End Module

Any help would be much appriciated.
Thanks a lot!

Viewing all articles
Browse latest Browse all 27107

Trending Articles



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