answer.
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
kifflom [539]
2 years ago
15

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 = , VIE 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. (25 points)

Engineering
1 answer:
zubka84 [21]2 years ago
4 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

3.

Follow of nullable variable X is Follow (V).

Follow (S) = $

Follow (T) = {z, w}

Follow (V) = ;

Follow (X) = Follow (V) = ;

Follow (C) = , and ;

Explanation:

You might be interested in
Radioactive wastes are temporarily stored in a spherical container, the center of which is buried a distance of 10 m below the e
puteri [66]

Given:

outer radius, R' = 10 m

inner diameter, d = 2 m

inner radius, R = \frac{d}{2} = 1 m

surface temperature, T' = 20^{\circ}C

Thermal conductivity of soil, K = 0.52 W/mK

Solution:

To calculate the thermal temperature of conductor, T, we know amount of heat, Q is given by :

Q =  \frac{T - T'}{\frac{R' - R}{4\pi KRR'}}

500 =  (T - 20)\frac{4\pi \times0.52\times 1\times 10}{10 - 1}

T = 68.86 +20 = 88.865^{\circ}C  

Therefore, outside surface temperature is 88.865^{\circ}C  

4 0
2 years ago
An electrical utility delivers 6.25E10 kWh of power to its customers in a year. What is the average power required during the ye
Sindrei [870]

Answer:

The overall Utility delivered to customers in a year 'U' = 6.25 X 10¹⁰Kwh

However, the average power P, required for a year, t  = ? Kw

Expressing their relationship, we will have

             U = P x t

Given t = 1 year = 24 x 365 hours (assume a year operation is 365 days)

          t = 8760 hours

P = \frac{62500000000}{8760}

P = 7134.7Kw

Hence, the average power required during the year is 7,135Kw

Now to calculate the energy used by the power plant in a year (in quads)?

Recall, Efficiency, η = Power Output/Power Input (100)

so, we have

η = P₀/P₁, given

0.45 = \frac{7134.7Kw}{P₁}

P₁ = 15,855Kw

the total energy E₁ used in a year = 15,855x24x365 = 138.89MJoules

So to convert this to quads, Note;

1 quads of energy = 10¹⁵ Joules

The total energy used is 0.000000139 quads

Now to find the cubic feet of natural gas required to generate this power?

Note: 0.29Kwh of Power generated  = 1 cubic feet of natural gas used

Since, the power plant generated = 62500000000Kwh

The cubic feet of natural gas used = \frac{62500000000}{0.29}

Hence, 2.155x10²⁰cubic feet of N.gas was used to generate this much power.

8 0
2 years ago
The pump of a water distribution system is powered by a 6-kW electric motor whose efficiency is 95 percent. The water flow rate
Sonja [21]

Answer:

a) Mechanical efficiency (\varepsilon)=63.15%  b) Temperature rise= 0.028ºC

Explanation:

For the item a) you have to define the mechanical power introduced (Wmec) to the system and the power transferred to the water (Pw).

The power input (electric motor) is equal to the motor power multiplied by the efficiency. Thus, Wmec=0.95*6kW=5.7 kW.

Then, the power transferred (Pw) to the fluid is equal to the flow rate (Q) multiplied by the pressure jump \Delta P. So P_W = Q*\Delta P=0.018m^3/s * 200x10^3 Pa=3600W.

The efficiency is defined as the ratio between the output energy and the input energy. Then, the mechanical efficiency is \varepsilon=3.6kW/5.7kW=0.6315=63.15\%

For the b) item you have to consider that the inefficiency goes to the fluid as heat. So it is necessary to use the equation of the heat capacity but in a "flux" way. Calling <em>H</em> to the heat transfered to the fluid, the specif heat of the water and \rho the density of the water:

[tex]H=(5.7-3.6) kW=\rho*Q*c*\Delta T=1000kg/m^3*0.018m^3/s*4186J/(kg \ºC)*\Delta T[/tex]

Finally, the temperature rise is:

\Delta T=2100/75348 \ºC=0.028 \ºC

7 0
2 years ago
A converging-diverging nozzle is designed to operate with an exit Mach number of 1.75 . The nozzle is supplied from an air reser
Flura [38]

Answer:

a. 4.279 MPa

b. 3.198 MPa to 4.279 MPa

c. 0.939 MPa

d. Below 3.198 MPa

Explanation:

From the given parameters

M_{exit} = 1.75 MPa  

M at 1.6 MPa gives A_{exit}/A* = 1.2502

M at 1.8 MPa gives  A_{exit}/A* = 1.4390

Therefore, by interpolation, we have M_{exit} = 1.75 MPa  gives A

However, we shall use M_{exit} = 1.75 MPa and A

Similarly,

P_{exit}/P₀ = 0.1878

a) Where the nozzle is choked at the throat there is subsonic flow in the following diverging part of the nozzle. From tables, we have

A_{exit}/A* = 1.387. by interpolation M

Therefore P_{exit} = P₀ × P

Which shows that the nozzle is choked for back pressures lower than 4.279 MPa

b) Where there is a normal shock at the exit of the nozzle, we have;

M₁ = 1.75 MPa, P₁ = 0.1878 × 5 = 0.939 MPa

Where the normal shock is at M₁ = 1.75 MPa, P₂/P₁ = 3.406

Where the normal shock occurs at the nozzle exit, we have

P_b = 3.406\times 0.939 = 3.198 MPa

Where the shock occurs t the section prior to the nozzle exit from the throat, the back pressure was derived as P_b = 4.279 MPa

Therefore the back pressure value ranges from 3.198 MPa to 4.279 MPa

c) At M_{exit} = 1.75 MPa  and P

d) Where the back pressure is less than 3.198 MPa according to isentropic flow relations supersonic flow will exist at the exit plane    

8 0
2 years ago
Consider an infinitely thin flat plate of chord c at an angle of attack α in a supersonic flow. The pressure on the upper and lo
amm1812

Answer:

X_cp = c/2

Explanation:

We are given;

Chord = c

Angle of attack = α

p u (s) = c 1

​p1(s)=c2,

and c2 > c1

First of all, we need to find the resultant normal force on the plate and the total moment about leading edge.

I've attached the solution

4 0
2 years ago
Other questions:
  • A curve in a speed track has a radius of 1000 ft and a rated speed of 120 mi/h. (From Sample Prob. 12.7 is the definition of rat
    10·1 answer
  • 2. A ¼ in. diameter rod must be machined on a lathe to a smaller diameter for use as a specimen in a tension test. The rod mater
    9·1 answer
  • Water is to be withdrawn from an 8-m-high water reservoir by drilling a 2.2-cm-diameter hole at the bottom surface. Disregarding
    12·2 answers
  • An air standard cycle with constant specific heats is executed in a closed pistoncylinder system and is composed of the followin
    10·1 answer
  • A heat recovery device involves transferring energy from the hot flue gases passing through an annular region to pressurized wat
    6·1 answer
  • An ideal Stirling cycle filled with air uses a 75 F energy reservoir as a sink. The engine is designed to so that the maximum ai
    8·1 answer
  • A rectangular beam having b=300 mm and d=575 mm, spans 5.5 m face to face of simple supports. It is reinforced for flexure with
    14·1 answer
  • Water at 70 kPa and 1008C is compressed isentropically in a closed system to 4 MPa. Determine the final temperature of the water
    6·1 answer
  • While at a concert you notice five people in the crowd headed in the same direction. Your tendency to group them is due to? *
    10·1 answer
  • Problema sobre programacion orientada a objetos!!
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!