A Deterministic Finite Automaton (DFA) that checks if the provided string conforms to NJIT's email format.
The DFA checks the format of emails based on the following rules:
- The email starts with alphabets.
- It can contain numbers and alphabets before '@'.
- It should contain a '@' followed by alphabets, numbers, or '.'.
- If the email contains '.edu' as the domain, it is accepted.
- Run the program.
- When prompted, decide whether you want to enter a string with
y
orn
.- If
n
is chosen, the program will exit. - If
y
is chosen, the user will be prompted to enter a string over Σ (the alphabet).
- If
- Enter the string and the program will provide immediate feedback for each letter processed.
- At the end, the program will indicate whether the string is "Accepted" (conforms to the email format) or "Rejected".
Σ
: The entire set of characters which includes numbers (0-9), alphabets (a-z), '.', and '@'.upsilon
: Numbers 0-9.psi
: Alphabets a-z.delta
: '.' character.theta
: '@' character.
- The DFA transitions and states are printed out for each character processed for clarity.
- The program continues to prompt the user to input strings until they choose to exit by entering
n
.