You are on page 1of 2

Imports System

Module Program
Sub Main(ByVal args As String())
Dim adminUsername As String = "admin"
Dim adminPassword As String = "lele"
Dim loggedInUser As String = ""

Do
Console.WriteLine("Enter username: ")
Dim username As String = Console.ReadLine()
Console.WriteLine("Enter password: ")
Dim password As String = Console.ReadLine()

If username = adminUsername AndAlso password = adminPassword Then


loggedInUser = username
Console.WriteLine("Login successful!")
Dim calcChoice As String = ""

Do
Console.WriteLine(" ===================== ")
Console.WriteLine(" || CALCULATOR || ")
Console.WriteLine(" ===================== ")
Console.WriteLine("Choose an operation:")
Console.WriteLine("1. Add")
Console.WriteLine("2. Subtract")
Console.WriteLine("3. Multiply")
Console.WriteLine("4. Divide")
Console.WriteLine("5. Logout")
calcChoice = Console.ReadLine()

Select Case calcChoice


Case "1"
Exit Select
Case "2"
Exit Select
Case "3"
Exit Select
Case "4"
Exit Select
Case "5"
Console.WriteLine("Logging out...")
loggedInUser = ""
Exit Select
End Select
Loop While calcChoice <> "5"
Else
Console.WriteLine("Login failed. Incorrect username or password.")
End If
Loop While loggedInUser = ""

Console.Clear()
End Sub
End Module

You might also like