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
kifflom [539]
3 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]3 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
Diodes can be used to protect electronic components from certain flowing in another Direction describe another application outsi
Anvisha [2.4K]

Answer:

Plumbing  using a one-way check valve to stop water flowing back on a pump when the pump shuts off.

Explanation:

Diodes are like check valves, keeping current from flowing both ways.  Used to create d.c. out of a.c by rectification.  Also to block flow if d.c. power like a battery is hooked up in reverse polarity.

4 0
3 years ago
Which is an appropriate type of face and eye protection for resistance welding?
Flura [38]

Answer:

While resistance welding you should wear clear grinding glasses, unbreakable plastic face shields or clear unbreakable plastic goggles. When resistance welding a #10, or more, shade lens should be worn. All hand and portable tools should be inspected for loose parts, cleanliness, or worn power cords.

7 0
3 years ago
The electron beam in a TV picture tube carries 1015 electrons per second. As a design engineer, determine the voltage needed to
leonid [27]

Answer:

The voltage needed to accelerate the electron beam is 2.46 x 10^16 Volts

Explanation:

The rate of electron flow is given as:

q = 1015 electrons per second

The total current is given by:

Total Current = (Rate of electron flow)(Charge on one electron)

Total Current = I = (1015 electrons/s)(1.6 x 10^-19 C/electron)

I = 1.624 x 10^-16 A

Now, we know that electric power is given as:

Electric Power = Current x Voltage

P = IV

V = P/I

V = 4 W/1.624 X 10^-16 A

<u>V = 2.46 x 10^16 Volts</u>

6 0
3 years ago
What possible scenarios may happen if you do the task without using PPE?
ale4655 [162]
Without PPE, employees are at risk of Cuts and punctures. Chemical burns. Electric shocks. Exposure to excessive noise or vibration.
8 0
3 years ago
Argon is compressed in a polytropic process with n = 1.2 from 120 kPa and 10°C to 850 kPa in a piston–cylinder device. Determine
Ivenika [448]

Answer:

W=-109.12 kJ/kg

Q=-76.34 kJ/kg

Explanation:

The needed work W we will calculate by using the work equation for polytropic process and the heat transfer Q we will calculate by using the energy balance equation.

Before the calculations we first need to determine the final temperature T2. We will do that by using the given initial temperature T1 = 10°C, the given initial p_1 = 120 kPa and final p_2 = 800 kPa pressure and the polytropic index n = 1.2. Before the calculation we need to express the temperature in K units.  

T1 = 10°C + 273 K = 283 K  

T2 = ((p_2/p_1)^(n-1)/n)* T1

T2 = 388 K

Now we can use the heat capacity C_v, = 0.3122 kJ /kg K and the temperatures T1 and T2 to determine the change in internal energy ΔU.  

ΔU = C_v*(T2-T1)

ΔU = 32.78 kJ/kg

to determine the work we will also need the initial v1 and final v2 specific volume. The initial specific volume v1 we can determine from the ideal gas equation. For the calculation we will need the initial pressure p_1, temperature T1 and the specific gas constant R = 0.2081 kJ /kg K.  

v1=R*T1/p_1

v1=0.4908 m^3/kg

For the final specific volume we need to replace the initial temperature and pressure with the final.  

v2=R*T2/p_2

v2=0.1009 m^3/kg

The work W is then:  

W=p_2*v2-p_1*v1/n-1

W=-109.12 kJ/kg

The heat transfer Q we can calculate form the energy balance equation. For the calculation we will need the calculated work W and the change in internal energy ΔU.  

Q=W+ΔU

Q=-76.34 kJ/kg

7 0
4 years ago
Other questions:
  • The man of mass m1 = 82 kg and the woman of mass m2 = 80 kg are standing on opposite ends of the platform of mass m0 = 103 kg wh
    14·1 answer
  • A mass of 12 kg saturated refrigerant-134a vapor is contained in a piston-cylinder device at 240 kPa. Now 300 kJ of heat is tran
    8·1 answer
  • If we have silicon at 300K with 10 microns of p-type doping of 4.48*10^18/cc and 10 microns of n-type doping at 1000 times less
    7·1 answer
  • Two resistors, with resistances R1 and R2, are connected in series. R1 is normally distributed with mean 65 and standard deviati
    12·1 answer
  • Water enters the tubes of a cold plate at 70°F with an average velocity of 40 ft/min and leaves at 105°F. The diameter of the tu
    8·1 answer
  • A device that converts the chemical energy from a fuel into electricity through a
    12·2 answers
  • How much thermal energy is needed to raise the temperature of 15kg gold from 45⁰ C up to 80⁰ C​
    10·1 answer
  • 1. A six lane freeway (three lanes in each direction) currently operates at maximum LOS C conditions. The lanes are 11 ft wide,
    7·1 answer
  • The on-board computer controls the suspension system based on inputs from?
    10·1 answer
  • What event occurred closest in the time to the sinking of the Titanic?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!