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
A train consists of a 50 Mg engine and three cars, each having a mass of 30 Mg . If it takes 75 s for the train to increase its
ohaa [14]

Answer:

T = 15 kN

F = 23.33 kN

Explanation:

Given the data in the question,

We apply the impulse momentum principle on the total system,

mv₁ + ∑\int\limits^{t2}_{t1} {Fx} \, dt = mv₂

we substitute

[50 + 3(30)]×10³ × 0 + FΔt = [50 + 3(30)]×10³ ×  ( 45 × 1000 / 3600 )  

F( 75 - 0 ) =  1.75 × 10⁶

The resultant frictional tractive force F is will then be;

F =  1.75 × 10⁶ / 75

F = 23333.33 N

F = 23.33 kN

Applying the impulse momentum principle on the three cars;

mv₁ + ∑\int\limits^{t2}_{t1} {Fx} \, dt = mv₂

[3(30)]×10³ × 0 + FΔt = [3(30)]×10³ ×  ( 45 × 1000 / 3600 )  

F(75-0) = 1.125 × 10⁶

The force T developed is then;

T =  1.125 × 10⁶ / 75

T = 15000 N

T = 15 kN

7 0
3 years ago
What is a voltage divider circuit and how do you calculate the voltage across one element in a series
Rama09 [41]
Sorry I don’t know myself
6 0
2 years ago
According to the video, what are examples of systems that Stationary Engineers oversee? Check all that apply. electrical systems
garik1379 [7]

Answer:

electrial systems

fire systems

heating systems

air systems

Explanation:

3 0
3 years ago
Read 2 more answers
What impact does modulus elasticity have on the structural behavior of a mechanical design?
devlian [24]

Answer with Explanation:

The modulus of elasticity has an profound effect on the mechanical design of any machine part as explained below:

1) Effect on the stiffness of the member: The ability of any member of a machine to resist any force depends on the stiffness of the member. For a member with large modulus of elasticity the stiffness is more and hence in cases when the member has to resist a direct load the member with more modulus of elasticity resists the force better.

2)Effect on the deflection of the member: The deflection caused by a force in a member is inversely proportional to the modulus of elasticity of the member thus in machine parts in which we need to resist the deflections caused by the load we can use materials with greater modulus of elasticity.

3) Effect to resistance of shear and torque: Modulus of rigidity of a material is found to be larger if the modulus of elasticity of the material is more hence for a material with larger modulus of elasticity  the resistance it offer's to shear forces and the torques is more.

While designing a machine element since the above factors are important to consider thus we conclude that modulus of elasticity has a profound impact on machine design.

8 0
3 years ago
List three types of concurrent engineering in manufacturing.
klio [65]

Answer:

A famous example of concurrent engineering is the development of the Boeing 777 commercial aircraft. The aircraft was designed and built by geographically distributed companies that worked entirely on a common product database of C A TIA without building physical mock-ups but with digital product definitions.

8 0
2 years ago
Other questions:
  • A rod is 2m long at temperature of 10oC. Find the expansion of the rod, when the temperature is raised to 80oC. If this expansio
    7·1 answer
  • what is the method of the slope stabilization, and how many type of method of the stabilization, please help explain the types o
    13·1 answer
  • You are using a Geiger counter to measure the activity of a radioactive substance over the course of several minutes. If the rea
    6·1 answer
  • A preheater involves the use of condensing steam at 100o C on the inside of a bank of tubes to heat air that enters at I atm and
    14·1 answer
  • Hiiiiiiiii<br> jhajwjne f f g. g g tnnjzjnsnsnend f najjwne d f nskiaksjsjsjksm
    5·1 answer
  • A fan draws air from the atmosphere through a 0.30-mdiameter round duct that has a smoothly rounded entrance. A differential man
    14·1 answer
  • Lance is the sitting judge in the local family court. What education might have been
    10·1 answer
  • What was a campaign belief in the 1980 presidential election? Carter called for a stronger national defense. Carter promised to
    7·2 answers
  • Q1: The first option should always be to get out safely (RUN)
    6·1 answer
  • Overconfidence in more male drivers, particularly those under 25 years old, results in them being involved in crashes.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!