Click here to Skip to main content
15,896,154 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i need to build a JAVA or c# program which implements a DFA

my DFA shall accept a password of my choice.

my password shall be at least 8 characters long;

It must have a combination of characters (small and capital), digits, and special characters.


For example: my password can be described as follows

1- must be at least 8 characters

2- Must begin wiht the special symbol @

3- Must end with a capital letter

4 Must have at least 2 digits

What I have tried:

tried to create two dimensional array to fill the row as number of accepted character like @,digit.. etc and the column as the number of state
Posted
Updated 11-Mar-16 9:53am

1 solution

Study the theory, it is not difficult. A starting point could the DFA Wikipedia page: "Deterministic finite automaton - Wikipedia, the free encyclopedia"[^].
I would start building a very basic automaton satisfying just one of the requirements. Then it should be reletively simple to progressively augment it in order to eventually comply to all the other ones.
 
Share this answer
 
Comments
Garth J Lancaster 11-Mar-16 19:34pm    
'cinque' :-)
CPallini 12-Mar-16 4:32am    
'Grazie, signore!' :-)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900