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
The water requirement for Class H cement is 38% (i.e.,water (%) by weight of cement),whereas the water requirement for barite is
Vikentia [17]

Answer:

weight of barite = 398.4355 kg

Explanation:

Solution:- The values given in the question are as follows:

water requirement for H class cement = 38% by weight of cement

water requirement for barite = 2.4 gal / 100 lbm

H class cement slurry = 15.7 lbm/gal

one sack of cement = 50 kg or 110.231 lbm

one sack of cement require water = (38/100)*110.231

one sack of cement require water = 41.8877 gal

water required 100 lbm barite = 2.4 gal

or water required barite = 2.4% by weight of barite

H class cement slurry = (weight of cement + weight of barite)/total weight of water

15.7 =(110.231 + weight of barite)/(water required one sack of cement + 2.4%*weight of barite)

15.7 = 110.231 + (weight of barite)/(41.887 + 0.024*weight of barite)

15.7*41.8877 + 15.7*0.024*weight of barite = 110.231 + weight of barite

657.6368 + 0.3768*weight of barite = 110.231 + weight of barite

547.4058 =0.6232*weight of barite

weight of barite = 878.379 lbm or 878.4 lbm

weight of barite = 398.4355 kg

7 0
3 years ago
10. To cut 1/4" (6 mm) thick mild steel at a rate of 40 inches per minute, the current would be set to
pishuonlain [190]

Answer: Idk but try downloading more apps it’s a lot easier to have more than one

Explanation:

5 0
3 years ago
____________ is the range of all the colors created by different amounts of light.
astra-53 [7]
The answer to your question is value.
7 0
3 years ago
Read 2 more answers
A hub a signal that refreshes the signal strength.
vekshin1

Answer:You are a network engineer. While moving a handheld wireless LAN device, you notice that the signal strength increases when the device is moved from a ...

Explanation:

7 0
3 years ago
Tech A says that thrust angle refers to the direction the front wheels are pointing. Tech B says that scrub radius refers to the
kenny6666 [7]

Both of the technicians are correct.

<u>Explanation:</u>

The thrust angle is defined as the angle formed by the imaginary line drawn perpendicular to the rear axis center line. It is used in alignment of the four wheels.

It is also used to determine the direction the front wheels are pointing. While the scrub radius is the intersecting point of the vertical center line of front tires with the imaginary line drawn from the steering knuckles.

Thus both the technicians are saying correct. The thrust angle and scrub radius are used to determine the alignment of wheels, if there is any misalignment in wheels then it needs to make it correct to prevent accidents.

4 0
3 years ago
Other questions:
  • This assignment covers the sequential circuit component: Register and ALU. In this assignment you are supposed to create your ow
    13·1 answer
  • Which statement about direct-mail messages is most accurate? Group of answer choices Direct mail is an effective channel for per
    15·1 answer
  • Technician A says ASE certification is mandatory in all 50 states before performing an automotive repair for pay. Technician B s
    12·1 answer
  • Pascal's law tells us that, pressure is transmitted undiminished throughout an open container. a)- True b) False
    9·1 answer
  • Create a program that calculates the monthly payments on a loan using Decimal &amp; LC Console SEE Sanple Run Attached Specifica
    14·1 answer
  • Getting a haircut from a barber is an example of a service that can be purchased. Please select the best answer from the choices
    9·2 answers
  • So far in your lifetime, about how much garbage have you contributed
    12·1 answer
  • A hot plate with a temperature of 60 C, 50 triangular profile needle wings of length (54 mm), diameter 10 mm (k = 204W / mK) wil
    6·1 answer
  • You are given a C program "q2.c" as below. This program is used to calculate the average word length for a sentence (a string in
    5·1 answer
  • How do Geothermal plowerplants relate to engineering?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!