A DFA program that implements L = {ad, accd, bcd, bcccd,acecd} - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

A DFA program that implements L = {ad, accd, bcd, bcccd,acecd}

daleykdaleyk Posts: 2Member
Hi Guys,

I am during a course called Theory of Computattion and have this assignment to do but need some help. I am to write a program that implement this language L = {ad, accd, bcd, bcccd,acecd}. Is there any one that can assist in writing this code. Thia automaton should accepts all and only the strings of the language.

Comments

  • DonotaloDonotalo Posts: 715Member
    : Hi Guys,
    :
    : I am during a course called Theory of Computattion and have this assignment to do but need some help. I am to write a program that implement this language L = {ad, accd, bcd, bcccd,acecd}. Is there any one that can assist in writing this code. Thia automaton should accepts all and only the strings of the language.
    :
    [purple]are there only five strings in the language? then the program is very easy. just take the input string, check whether it is "ad", if not then whether it is "accd", and so on. u need only five string comparisons at most.
    [/purple]
    [hr][purple]~Donotalo()[/purple]

  • daleykdaleyk Posts: 2Member
    : Hi Guys,
    :
    : I am during a course called Theory of Computattion and have this assignment to do but need some help. I am to write a program that implement this language L = {ad, accd, bcd, bcccd,acecd}. Is there any one that can assist in writing this code. Thia automaton should accepts all and only the strings of the language.
    :
    Can you write a quick code for me?
  • DonotaloDonotalo Posts: 715Member
    : : Hi Guys,
    : :
    : : I am during a course called Theory of Computattion and have this assignment to do but need some help. I am to write a program that implement this language L = {ad, accd, bcd, bcccd,acecd}. Is there any one that can assist in writing this code. Thia automaton should accepts all and only the strings of the language.
    : :
    : Can you write a quick code for me?
    :
    [code]
    #include
    using namespace std;

    int main()
    {
    char input[80];
    cout << "Enter input string: ";
    fgets(input, sizeof(input), stdin);

    //precess input
    return 0;
    }
    [/code]
    [hr][purple]~Donotalo()[/purple]

Sign In or Register to comment.