Vowel - if Learn programming Visual Basic (VB.net)

Lesson:

Basic Data Types


Exercise:

Vowel - if 12


Objetive:

Create a Visual Basic (VB.net) program to ask the user for a symbol and answer if it is a (lowercase) vowel, a digit, or any other symbol, using "if".


Code:

Imports System
Public Class exercise61
    Public Shared Sub Main()
        Dim symbol As Char
        Console.Write("Enter a symbol: ")
        symbol = Convert.ToChar(Console.ReadLine())

        If (symbol = "a"c) OrElse (symbol = "e"c) OrElse (symbol = "i"c) OrElse (symbol = "o"c) OrElse (symbol = "u"c) Then
            Console.WriteLine("It's a lowercase vowel.")
        ElseIf (symbol >= "0"c) AndAlso (symbol <= "9"c) Then
            Console.WriteLine("It's a digit.")
        Else
            Console.Write("It's another symbol.")
        End If
    End Sub
End Class