1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Andreas93 [3]
3 years ago
6

Create a C language program that can be used to construct any arbitrary Deterministic Finite Automaton corresponding to the FDA

definition above. a. Create structs for the: automaton, a state, and a transition. For example, the automaton should have a "states" field, which captures its set of states as a linked list.
Engineering
1 answer:
otez555 [7]3 years ago
5 0

Answer:

see the explanation

Explanation:

/* C Program to construct Deterministic Finite Automaton */

#include <stdio.h>

#include <DFA.h>

#include <stdlib.h>

#include <math.h>

#include <string.h>

#include <stdbool.h>

struct node{

struct node *initialStateID0;

struct node *presentStateID1;

};

printf("Please enter the total number of states:");

scanf("%d",&count);

//To create the Deterministic Finite Automata

DFA* create_dfa DFA(){

  q=(struct node *)malloc(sizeof(struct node)*count);

  dfa->initialStateID = -1;

  dfa->presentStateID = -1;

  dfa->totalNumOfStates = 0;

  return dfa;

}

//To make the next transition

void NextTransition(DFA* dfa, char c)

{

  int tID;

  for (tID = 0; tID < pPresentState->numOfTransitions; tID++){

       if (pPresentState->transitions[tID].condition(c))

      {

          dfa->presentStateID = pPresentState->transitions[tID].toStateID;

          return;

      }

  }

  dfa->presentStateID = pPresentState->defaultToStateID;

}

//To Add the state to DFA by using number of states

void State_add (DFA* pDFA, DFAState* newState)

{  

  newState->ID = pDFA->numOfStates;

  pDFA->states[pDFA->numOfStates] = newState;

  pDFA->numOfStates++;

}

void transition_Add (DFA* dfa, int fromStateID, int(*condition)(char), int toStateID)

{

  DFAState* state = dfa->states[fromStateID];

  state->transitions[state->numOfTransitions].toStateID = toStateID;

  state->numOfTransitions++;

}

void reset(DFA* dfa)

{

  dfa->presentStateID = dfa->initialStateID;

}

You might be interested in
Which apparatus is likely to carry a ladder? (There may be more than one answer.)
Aloiza [94]
B and D
hope this helped
4 0
3 years ago
The underground cafe has an operating cash flow of $187,000 and a cash flow to creditors of $71,400 for the past year. During th
Serggg [28]

Answer:

cash flow to stockholders = $39,700

Explanation:

Operating cash flow = $187,000

cash flow to creditors = $71,400

Net working capital = $28,000

Net capital spending =  $47,900

Cash flow to stockholders = ?

CFF = operating cash flow - net working capital - net capital spending

CFF = $187,000 - $28,000 - $47,900 = $111,100

CFF = cash flow to creditors + cash flow to stockholders

cash flow to stockholders = CFF - cash flow to creditors

cash flow to stockholders = $111,100 - $71,400 = $39,700

Hence $39,700 is the amount of the cash flow to stockholders for the last year.

3 0
3 years ago
True or False: Stress can effectively be relieved through physical activity, getting enough rest and sleep, and relaxation techn
Neko [114]

Answer:

True

Explanation:

Actually this are some of the nitty gritty answers and ways to control or stip stress, lemme explain them you see stress most of the time may come from deep thoughts that are and are pushing you to the wall, and you in your state you as you react to that which is so demanding as it makes you tense,so if at you will incorporate physical activities like running, jogging or push ups the psychological tension in you is broken as you focus so much on the activities rather than the tension, then getting enough rest cools the mind and all your thoughts settle as in your brain starts to adapt to chilling and relaxation and enough sleep will actually make ones head to be at peace because if you lack enough sleep you might have an excruciating migraine when you are stressed up and finally relaxation techniques makes the body accept the situation and then you manouver out of it as you grow strongly.

Hope this will help!

7 0
3 years ago
Read 2 more answers
A rigid tank contains 3 kg of water initially at 43.97% quality and at a temperature of 120°C. The water is heated until it reac
makkiz [27]

Explanation: see attachment below

6 0
3 years ago
Which of the following hazards is shared by surface mining and sub-surface mining?
lubasha [3.4K]

B I guess. since they both have potential to collapse

4 0
3 years ago
Read 2 more answers
Other questions:
  • Now, suppose that you have a balanced stereo signal in which the left and right channels have the same voltage amplitude, 500 mV
    8·1 answer
  • A contractor is planning on including several skylights in each unit of a residential development. What type of worker would she
    12·1 answer
  • When a user process is interrupted or causes a processor exception, the x86 hardware switches the stack pointer to a kernel stac
    13·1 answer
  • Who invented a control unit for an artificial heart?<br> ements<br> ante
    8·1 answer
  • 1. What's the maximum overall length of the part?<br> 2. What material is used to fabricate the part
    5·1 answer
  • The term _______________refers to the science of using fluids to perform work.
    9·2 answers
  • Discuss in detail the manners of interaction with opposite gender
    10·1 answer
  • a coiled spring is stretched 31.50 cm by a 2.00N weight. How far is it stretched by a 10.00 N weight?
    6·1 answer
  • Integrated circuits typically are mounted on ________, which are then plugged into the system board.
    6·1 answer
  • When converting liquid level units to sensor output signal units, you should first convert the liquid level units to _____ units
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!