Password as string Learn programming Visual Basic (VB.net)

Lesson:

Basic Data Types


Exercise:

Password as string 19


Objetive:

Write a Visual Basic (VB.net) program to ask the user for his/her name and his/her password (both must be strings) and repeat it as many times as necessary, until the entered name is "user" and the password is "password".


Code:

Imports System
Public Class exercise51
    Public Shared Sub Main()
        Dim user, password As String

        Do
            Console.Write("Enter a user: ")
            user = Console.ReadLine()
            Console.Write("Enter a password: ")
            password = Console.ReadLine()
        Loop While user <> "user" AndAlso password <> "password"

        Console.WriteLine("Bye!")
    End Sub
End Class