0% found this document useful (0 votes)
26 views2 pages

Francis Hadriel B. Pomida-g12-Ict Programming - Output 2problem # 3

Uploaded by

Francis
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views2 pages

Francis Hadriel B. Pomida-g12-Ict Programming - Output 2problem # 3

Uploaded by

Francis
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

QUARTER 3

Subject Programming (Specialized)


Garde & Strand: 12-ICT Programming (TVL)
Name: Francis Hadriel B. Pomida

LAS 1 – Activity 2 --no3(Problem#3)


PROBLEM # 3:
Create a program for managing user or log on for a certain number of times. The following should be
observed in the program:
a. Should allow the user to log on three times.
b. if the user enters a username and password that matches with the set username and password in
the code, use a message box to display "Access Granted", then will exit the console when the OK
button is clicked.
c. if the input do not match, use a message box to display "Incorrect username and password" and
then go back to log on details.
OUTPUT # 3:

Module Module1
Dim usrname As String
Dim passwrd As String
Dim count As Integer = 1
Sub Main()
Console.Write("USERNAME: ")
usrname = (Console.ReadLine)
Console.Write("PASSWORD: ")
passwrd = (Console.ReadLine)
If usrname = "Senku" And passwrd = "qwerty" Then
MsgBox("Acces Granted", 64 + 0, "HURRAY")
If MsgBoxResult.Ok Then
Exit Sub
End If
Else
MsgBox("Pls Try again", 16 + 0, "Attention")
If MsgBoxResult.Ok Then
While count <= 4
count = count + 1
If count = 0 Then
Console.Clear()
Main()
ElseIf count = 1 Then
Console.Clear()
Main()
ElseIf count = 2 Then
Console.Clear()
Main()
ElseIf count = 3 Then
Console.Clear()
Main()
ElseIf count = 4 Then
Console.Clear()
Else
MsgBox("BETTER LUCK NEXT TIME", 64 + 0, "FAIL TO LOGIN")
If MsgBoxResult.Ok Then
Exit Sub
End If
End If
End While
End If
End If
End Sub
End Module

You might also like