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
John has just graduated from State University. He owes $35,000 in college loans, but he does not have a job yet. The college loa
IRISSAK [1]

Answer:

The correct response is "821.88". A further explanation is given below.

Explanation:

According to the question,

The largest amount unresolved after five years would have been:

= 35000\times (\frac{F}{P}, 4 \ percent,5 )

= 35000\times 1.216 7

= 42584.50

Now,

time (t) will be:

= 5\times 12

= 60 \ monthly \ payments

So, monthly payment will be:

= 42582.85\times (\frac{A}{P}, 0.5 \ percent,60 )

= 42584.50\times 0.0193

= 821.88

6 0
3 years ago
A prototype boat is 30 meters long and is designed to cruise at 9 m/s. Its drag is to be simulated by a 0.5-meter-long model pul
Ghella [55]

Answer:

a) 1.16 m/s

b)  1/216000

c)  (√15)/6480000

Explanation:

The parameters given are;

Length of boat prototype, lp = 30 m

Speed of boat prototype = 9 m/s

Length of boat model, lm= 0.5 m

a) lm/lp = 0.5/30 = 1/60 = ∝

(vm/vp) = ∝^(1/2) = √∝ = (1/60)^(1/2)

vm = 9 × (1/60)^(1/2) = 1.16 m/s

b) The ratio of the model to prototype drag, Fm/Fp, is given as follows;

Fm/Fp = (vm/vp)²×(lm/lp)² = ∝³

Fm/Fp = (1/60)³ = 1/216000

c) The ratio of the model to prototype power  pm/p_p = (Fm/Fp) × (vm/vp) = ∝³×√∝

The ratio of the model to prototype power  pm/p_p = √(1/60) × (1/60)³

pm/p_p = √(1/60) × (1/60)³ = (√15)/6480000

6 0
3 years ago
Lockheed Martin Skunk Works designs and produces aircraft for defense using rapid prototyping tools
Leni [432]
Answer true


Explanation
4 0
3 years ago
the increase of current when 15 V is applied to 10000ohm rheostat which is adjusted to 1000ohm value​
Anastasy [175]
Given data:
•) applied voltage = 15 V
•). Resistance = 1000 ohm

Required:
•). The magnitude of current= ?

•••••••••••••SOLUTION•••••••••••••

We can find the relation ship between current, voltage and resistance with the help of Ohms law.

According to ohms law;

V= IR.

Rearranging the above equation;

I= V/ R

Putt the values in the above equation; we get

I= 15V/ 1000ohm

I = 0.015 A( ampere)

••••••••••••••• CONCLUSION•••••••

The value of the current would be 0.15 ampere when Resistance is equal to 1000 and that of Voltage is equal to 15 V.
4 0
3 years ago
Complete function PrintPopcornTime(), with int parameter bagOunces, and void return type. If bagOunces is less than 3, print "To
weqwewe [10]

Answer:

#include <iostream>

using namespace std;

void PrintPopcornTime(int bagOunces) {

if(bagOunces < 3){

 cout << "Too small";

 cout << endl;

}

else if(bagOunces > 10){

 cout << "Too large";

 cout << endl;

}

else{

 cout << (6 * bagOunces) << " seconds" << endl;

}

}

int main() {

  PrintPopcornTime(7);

  return 0;

}

Explanation:

Using C++ to write the program. In line 1 we define the header "#include <iostream>"  that defines the standard input/output stream objects. In line 2 "using namespace std" gives me the ability to use classes or functions, From lines 5 to 17 we define the function "PrintPopcornTime(), with int parameter bagOunces" Line 19 we can then call the function using 7 as the argument "PrintPopcornTime(7);" to get the expected output.

8 0
3 years ago
Other questions:
  • Air enters the compressor of an ideal cold air-standard Brayton cycle at 100 kPa, 300 K, with a mass flow rate of 6 kg/s. The co
    11·1 answer
  • 1 2 3 4 5 6 7 8 9 10
    14·1 answer
  • Passband to baseband conversion: Consider the following passband signal,
    14·1 answer
  • Write analgorithm and a C code to calculate the sum and average value of an array12elements.For example: Array_Temperaure=[10, 1
    6·1 answer
  • Which of the following is not one of the systems required to ensure the safe and correct operation of an engine?
    5·1 answer
  • At the instant shown car A is travelling with a velocity of 24 m/s and which is decreasing at 4 m/s2 along the highway. At the s
    14·1 answer
  • Steam in a heating system flows through tubes whose outer diameter is 5 cm and whose walls are maintained at a temperature of 19
    13·1 answer
  • When you come to an intersection, follow the _________ before you proceed.
    6·2 answers
  • How frequently should vehicle registration be renewed?
    6·1 answer
  • What are the reasons why fine grained of alkali igneous rocks can not be used in cement
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!