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
REY [17]
3 years ago
14

In C++ the declaration of floating point variables starts with the type name float or double, followed by the name of the variab

le, and terminates with a semicolon. It is possible to declare multiple variables separated by commas in one statement. The following statements present examples,
float z;
double z, w;

The following partial grammar represents the specification for C++ style variable declaration. In this grammar, the letters z and w are terminals that represent two variable names. The non-terminal S is the start symbol.

S=TV;
V = cx
X= , V|E
T = float double
C = z|w

1. Determine Nullable values for the LHS and RHS of all rules. Please note, your answer includes all Nullable functions for LHS and RHS, in addition to the resulting values.
2. Using the Nullable values that you calculated in part 1, and using the FIRST sets that you calculated in part 2, determine the FOLLOW sets for all non-terminals, i.e. LHS of the rules. Please note, your answer includes all FOLLOW relations in addition to the resulting sets.
Engineering
1 answer:
Aliun [14]3 years ago
7 0

Answer:

The given grammar is :

S = T V ;

V = C X

X = , V | ε

T = float | double

C = z | w

1.

Nullable variables are the variables which generate ε ( epsilon ) after one or more steps.

From the given grammar,

Nullable variable is X as it generates ε ( epsilon ) in the production rule : X -> ε.

No other variables generate variable X or ε.

So, only variable X is nullable.

2.

First of nullable variable X is First (X ) = , and ε (epsilon).

L.H.S.

The first of other varibles are :

First (S) = {float, double }

First (T) = {float, double }

First (V) = {z, w}

First (C) = {z, w}

R.H.S.

First (T V ; ) = {float, double }

First ( C X ) = {z, w}

First (, V) = ,

First ( ε ) = ε

First (float) = float

First (double) = double

First (z) = z

First (w) = w

Explanation:

You might be interested in
A four-cylinder, four-stroke internal combustion engine has a bore of 3.7 in. and a stroke of 3.4 in. The clearance volume is 16
Bad White [126]

Answer:

the net work per cycle \mathbf{W_{net} = 0.777593696}  Btu per cycle

the power developed by the engine, W = 88.0144746 hp

Explanation:

the information given includes;

diameter of the four-cylinder bore = 3.7 in

length of the stroke = 3.4 in

The clearance volume = 16% = 0.16

The cylindrical volume V_2 = 0.16 V_1

the crankshaft N rotates at a speed of  2400 RPM.

At the beginning of the compression , temperature T_1 = 60 F = 519.67 R    

and;

Otto cycle with a pressure =  14.5 lbf/in² = (14.5 × 144 ) lb/ft²

= 2088 lb/ft²

The maximum temperature in the cycle is 5200 R

From the given information; the change in volume is:

V_1-V_2 = \dfrac{\pi}{4}D^2L

V_1-0.16V_1= \dfrac{\pi}{4}(3.7)^2(3.4)

V_1-0.16V_1= 36.55714291

0.84 V_1 =36.55714291

V_1 =\dfrac{36.55714291}{0.84 }

V_1 =43.52040823 \ in^3 \\ \\  V_1 = 43.52 \ in^3

V_1 = 0.02518 \ ft^3

the mass in air ( lb) can be determined by using the formula:

m = \dfrac{P_1V_1}{RT}

where;

R = 53.3533 ft.lbf/lb.R°

m = \dfrac{2088 \ lb/ft^2 \times 0.02518 \ ft^3}{53.3533 \ ft .lbf/lb.^0R  \times 519 .67 ^0 R}

m = 0.0018962 lb

From the tables  of ideal gas properties at Temperature 519.67 R

v_{r1} =158.58

u_1 = 88.62 Btu/lb

At state of volume 2; the relative volume can be determined as:

v_{r2} = v_{r1}  \times \dfrac{V_2}{V_1}

v_{r2} = 158.58 \times 0.16

v_{r2} = 25.3728

The specific energy u_2 at v_{r2} = 25.3728 is 184.7 Btu/lb

From the tables of ideal gas properties at maximum Temperature T = 5200 R

v_{r3} = 0.1828

u_3 = 1098 \ Btu/lb

To determine the relative volume at state 4; we have:

v_{r4} = v_{r3} \times \dfrac{V_1}{V_2}

v_{r4} =0.1828 \times \dfrac{1}{0.16}

v_{r4} =1.1425

The specific energy u_4 at v_{r4} =1.1425 is 591.84 Btu/lb

Now; the net work per cycle can now be calculated as by using the following formula:

W_{net} = Heat  \ supplied - Heat  \ rejected

W_{net} = m(u_3-u_2)-m(u_4 - u_1)

W_{net} = m(u_3-u_2- u_4 + u_1)

W_{net} = m(1098-184.7- 591.84 + 88.62)

W_{net} = 0.0018962 \times (1098-184.7- 591.84 + 88.62)

W_{net} = 0.0018962 \times (410.08)

\mathbf{W_{net} = 0.777593696}  Btu per cycle

the power developed by the engine, in horsepower. can be calculated as follows;

In the  four-cylinder, four-stroke internal combustion engine; the power developed by the engine can be calculated by using the expression:

W = 4 \times N'  \times W_{net

where ;

N' = \dfrac{2400}{2}

N' = 1200 cycles/min

N' = 1200 cycles/60 seconds

N' = 20 cycles/sec

W = 4 × 20 cycles/sec ×  0.777593696

W = 62.20749568 Btu/s

W = 88.0144746 hp

8 0
2 years ago
For a flow rate of 212 cfs find the critical depth in (a) a rectangular channel with ????=6.5 ft, (b) a triangular channel with
Fofino [41]

Answer:

A. 3.21ft

B. 3.51ft

C. 2.95ft

D. 1.5275ft

Explanation:

A) Q =212 cu.f/s

Formula for critical depth of rectangular section is: dc =[(Q^2) /(b^2(g))]^1/3

Where dc =critical depth, ft

Q= quantity of flow or discharge, ft3/s

B= width of channel, ft (m)

g = acceleration due to gravity which is 9.81m/s2 or 32.185ft/s2

Now, from the question,

Q = 212 cu.f/s and b=6.5ft

Therefore, the critical depth is: [(212^2)/(6.5^2 x32. 185)]^(1/3)

To give ; critical depth= (44,944/1359.82)^(1/3) = 3.21ft

B. Formula for critical depth of a triangular section; dc = (2Q^2/gm^2)^(1/5)

From the question, Q =212 cu.f/s and m=1.6ft while g= 32.185ft/s2

Therefore, critical depth = [(212^2) /(1.6^2 x32. 185)] ^(1/5) = (44,944/84.466)^(1/5) = 3.51ft

C. For trapezoidal channel, critical depth(y) is derived from (Q^2 /g) = (A^3/T)

Where A= (B + my)y and T=(B+2my)

Now from the question, B=6.5ft and m=5ft.

Therefore, A= (6.5 + 2y)y and T=(6. 5 + 2(5y))= 6.5 + 10y

Now, let's plug the value of A and T into the initial equation to derive the critical depth ;

(212^2 /32.185) = [((6.5 + 2y)^3)y^3]/ (6.5 + 10y)

Which gives;

1396.43 = [((6.5 + 2y)^3)y^3]/ (6.5 + 10y)

Multiply both sides by 6.5 + 10y to get;

1396.43(6.5 + 10y) = [((6.5 + 2y)^3)y^3]

Factorizing this, we get y = 2. 95ft

D) Formula for critical depth of a circular section; dc =D/2[1 - cos(Ѳ/2)]

Where D is diameter of pipe and Ѳ is angle at critical depth in radians.

Angle not given, so we assume it's perpendicular angle is 90.

Since angle is in radians, therefore Ѳ/2 = 90/2 = 45 radians ; converting to degree, = 2578. 31

Therefore, dc = (6.5/2) (1 - cos (2578.31))

dc = 3.25(1 - 0.53) = 3.25 x 0.47 = 1.5275ft

8 0
3 years ago
The current entering the positive terminal of a device is i(t)= 6e^-2t mA and the voltage across the device is v(t)= 10di/dtV.
liberstina [14]

Answer:

a) 2,945 mC

b) P(t) = -720*e^(-4t) uW

c) -180 uJ

Explanation:

Given:

                           i (t) = 6*e^(-2*t)

                           v (t) = 10*di / dt

Find:

( a) Find the charge delivered to the device between t=0 and t=2 s.

( b) Calculate the power absorbed.

( c) Determine the energy absorbed in 3 s.

Solution:

-  The amount of charge Q delivered can be determined by:                      

                                       dQ = i(t) . dt

                  Q = \int\limits^2_0 {i(t)} \, dt = \int\limits^2_0 {6*e^(-2t)} \, dt = 6*\int\limits^2_0 {e^(-2t)} \, dt

- Integrate and evaluate the on the interval:

                   = 6 * (-0.5)*e^-2t = - 3*( 1 / e^4 - 1) = 2.945 C

- The power can be calculated by using v(t) and i(t) as follows:

                 v(t) = 10* di / dt = 10*d(6*e^(-2*t)) /dt

                 v(t) = 10*(-12*e^(-2*t)) = -120*e^-2*t mV

                 P(t) = v(t)*i(t) = (-120*e^-2*t) * 6*e^(-2*t)

                 P(t) = -720*e^(-4t) uW

- The amount of energy W absorbed can be evaluated using P(t) as follows:

                 W = \int\limits^3_0 {P(t)} \, dt = \int\limits^2_0 {-720*e^(-4t)} \, dt = -720*\int\limits^2_0 {e^(-4t)} \, dt

- Integrate and evaluate the on the interval:

                  W = -180*e^-4t = - 180*( 1 / e^12 - 1) = -180uJ

6 0
3 years ago
Soils with low percolation rates do not need special attention during site engineering. select one: true false
saveliy_v [14]

It is accurate to say that site engineering does not require particular consideration for soils with low percolation rates.

<h3>What are percolation rates?</h3>
  • The rate at which water percolates through the soil is a measure of its ability to absorb and treat effluent, or wastewater that has undergone preliminary treatment in a septic tank.
  • Minutes per inch are used to measure percolation rate (mpi).
  • The process of a liquid gently moving through a filter is called percolation. This is how coffee is typically brewed.
  • The Latin verb percolare, which meaning "to strain through," is the source of the word "percolation." When liquid is strained through a filter, such as when making coffee, percolation occurs.

To learn more about percolation rates, refer to:

brainly.com/question/28170860

#SPJ4

7 0
1 year ago
What is the step in which you are testing your hypothesis ​
jonny [76]

Answer:

Step 1: State your null and alternate hypothesis. ...

Step 2: Collect data. ...

Step 3: Perform a statistical test. ...

Step 4: Decide whether the null hypothesis is supported or refuted. ...

Step 5: Present your findings.

8 0
2 years ago
Other questions:
  • A 3-kg block rests on top of a 2-kg block supported by, but not attached to, a spring of constant 40 N/m. The upper block is sud
    14·2 answers
  • A 0.25" diameter A36 steel rivet connects two 1" wide by .25" thick 6061-T6 Al strips in a single lap shear joint. The shear str
    12·1 answer
  • A friend would like you to build an "electronic eye" for use as a fake security device. The device consists of three lights line
    12·2 answers
  • A completely reversible heat pump produces heat ata rate of 300 kW to warm a house maintained at 24°C. Theexterior air, which is
    6·1 answer
  • Water is contained in a rigid vessel of 5 m3 at a quality of 0.8 and a pressure of 1 MPa. If the pressure is reduced to 270.3 kP
    9·1 answer
  • An ideal vapor-compression refrigeration cycle using refrigerant-134a as the working fluid is used to cool a brine solution to −
    12·1 answer
  • Draw the free-body diagram of the beam which supports the 80-kg load and is supported by the
    12·1 answer
  • The following is a series of questions pertaining to the NSPE Code of Ethics. Please indicate whether the statement are true or
    14·1 answer
  • Concerning the storage battery, what category of the primary sources is voltage produced?​
    13·1 answer
  • A company intends to market a new product and it estimates that there is a 20% chance that it will be first in the market
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!