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) For Well A, provide a cross-section sketch that shows (i) ground elevation, (ii) casing height, (iii) depth to
Ad libitum [116K]
Don’t go on that file will give a virus! Sorry just looking out and I don’t know how to comment!
7 0
3 years ago
Situation: Peter is designing a new hybrid car that functions on solar power. He is currently working on sketches of his design
givi [52]

Answer:

whats the question?

Explanation:

8 0
2 years ago
PLEASE HURRY!!!
Naily [24]

Answer:

A

Explanation:

He should get a job in engineering to see what it's like to work in the field.

3 0
2 years ago
Read 2 more answers
Describe each occupation
vitfil [10]

Answer:

Carpenter — A carpenter is someone who works with wood. They build houses and make cabinets etc.

Logging —  Loggers are people who cut trees. They use strong chain saws to cut trees.

Shipwrights — Shipwrights build, design, and repair all sizes of boats.

Wood Machinist — Wood Machinists repair and cut timber or any kind of wood for construction projects. They also operate woodworking machines, as their name suggest.

Furniture finishers —  Furniture finishers shape, decorate, and restore damaged and worn out furniture.

5 0
2 years ago
Six housing subdivisions within a city area are target for emergency service by a centralized fire station. Where should the new
Marina86 [1]

Answer:

Explanation:

Since there are six points, the minimum distance from all points would be the centroid of polygon formed by A,B,C,D,E,F

To find the coordinates of centroid of a polygon we use the following formula. Let A be area of the polygon.

C_{x}=\frac{1}{6A} sum(({x_{i} +x_{i+1})(x_{i}y_{i+1}-x_{i+1}y_{i}))     where i=1 to N-1 and N=6

C_{y}=\frac{1}{6A} sum(({y_{i} +y_{i+1})(x_{i}y_{i+1}-x_{i+1}y_{i}))

A area of the polygon can be found by the following formulaA=\frac{1}{2} sum(x_{i} y_{i+1} -x_{i+1} y_{i}) where i=1 to N-1

A=\frac{1}{2}[ (x_{1}  y_{2} -x_{2}  y_{1})+ (x_{2}  y_{3} -x_{3}  y_{2})+(x_{3}  y_{4} -x_{4}  y_{3})+(x_{4}  y_{5} -x_{5}  y_{4})+(x_{5}  y_{6} -x_{6}  y_{5})]

A=0.5[(20×25 -25×15) +(25×32 -13×25)+(13×21 -4×32)+(4×8 -18×21)+(18×14 -25×8)

A=225.5 miles²

Now putting the value of area in Cx and Cy

C_{x} =\frac{1}{6A}[ [(x_{1}+x_{2})(x_{1}  y_{2} -x_{2}  y_{1})]+ [(x_{2}+x_{3})(x_{2}  y_{3} -x_{3}  y_{2})]+[(x_{3}+x_{4})(x_{3}  y_{4} -x_{4}  y_{3})]+[(x_{4}+x_{5})(x_{4}  y_{5} -x_{5}  y_{4})]+[(x_{5}+x_{6})(x_{5}  y_{6} -x_{6}  y_{5})]]

putting the values of x's and y's you will get

C_{x} =15.36

For Cy

C_{y} =\frac{1}{6A}[ [(y_{1}+y_{2})(x_{1}  y_{2} -x_{2}  y_{1})]+ [(y_{2}+y_{3})(x_{2}  y_{3} -x_{3}  y_{2})]+[(y_{3}+y_{4})(x_{3}  y_{4} -x_{4}  y_{3})]+[(y_{4}+y_{5})(x_{4}  y_{5} -x_{5}  y_{4})]+[(y_{5}+y_{6})(x_{5}  y_{6} -x_{6}  y_{5})]]

putting the values of x's and y's you will get

C_{y} =22.55

So coordinates for the fire station should be (15.36,22.55)

5 0
3 years ago
Other questions:
  • What is shown in the above figure?
    11·2 answers
  • WHEN WAS THE FIRST CAR INVENTED?
    13·2 answers
  • Find the minimum diameter of an alloy, tensile strength 75 MPa, needed to support a 30 kN load.
    14·1 answer
  • Make sure that the switch is on (if the drill is electric), the chuck key is not removed before you plug in the drill or turn it
    11·2 answers
  • Pls help! 39 points!!
    5·2 answers
  • Assume a steel pipe of inner radius r1= 20 mm and outer radius r2= 25 mm, which is exposed to natural convection at h = 50 W/m2.
    12·1 answer
  • E xercise 17.1.2: For each of the transactions of Exercise 17.1.1, add the read- and write-actions to the computation and show t
    12·1 answer
  • 1. You are asked to write a report about one of the structures that Transportation Engineers
    9·1 answer
  • If a nurse does not agree to the discipline set due to a complaint made against this nurse, after reviewing the proposed agreed
    14·1 answer
  • Plz help If an item is $13.00 for a case of 24, then it is $
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!