You are on page 1of 7

Project

In Automata

Submitted by:
JOHN MARK GERERO
BSCS i2019

Submitted to:
Professor Ariel Tomagan
Code for the program:
(used language: VB.Net)

Public Class Form1


Private Sub Button1_Click(sender As Object, e As EventArgs) Handles
Button1.Click
Dim input As String = TextBox1.Text
Dim result As String
Dim count As Integer

If input.StartsWith("j") Then
result = "accepted"
ElseIf input.StartsWith("J") Then
result = "accepted"
Else
result = "not accepted"

End If

count = TextBox1.Text.Length

TextBox2.AppendText(result)
TextBox3.AppendText(count)

End Sub

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles


MyBase.Load
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles


Button2.Click
TextBox1.Text = String.Empty
TextBox2.Text = String.Empty
TextBox3.Text = String.Empty
End Sub
EXPLANATION:
This program accepts any words, number and symbols but starts with letter
“J”. This program will allow the user to input string, if the word, number or
symbol did not start with letter “J” the output will be “not accepted” but if the
string starts with letter “J” the output will be “accepted”. And this program
counts the total characters input by the user.

Example string that is accepted:


Johnmarkpogi%35%#$%#$%#$
Jmpanget123……….####
Juicyfruit$#$
j213123123123123123^^^^^
jordaNef349214>:””:”:;;5454%
jamesyap11111111111
jabol000023123123
juicyworld9999999
jejejejejejejejeje454545454
julangottttttttjjjajajaja%%%$
joraemon&$%$%???
javaman09090909U^$
juicekolord213213123123123213123
jejemonkaba???????
Jordanlangmalakasmagbasketball00000#$#$#
jajajaajajajaajjaja!@#@@$#%^&*(&^%$#
jurassciparcsfsdgsd{}{}{}{}{}{}
JUKALOT_#$_#$_#$_#$
jojojojjojoj@$#$
jisakol][][][][][][][]
jorad22432423423:~~````~~~~~
JOPAW0986545289$%$#%#$
Juicyfrui5$#@$@#$@3
Jisakol9009304034334
Outputs:

(not Accepted)
Accepted Strings:

You might also like