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
Alecsey [184]
3 years ago
14

g Part 2: The features arrived the grammar Splitting categories and non-terminals gets out of hand fast. An alternative to the p

roliferation of non-terminals is to attach features to the terminals and non-terminals, and use these features to constrain the grammar. Consider the case example in part 1. We split pro into pro_nom and pro_acc, and we split np into np_nom and np_acc. The sequence det n could be either, so we added two rules (one for np_nom, and one for np_acc) with identical right-hand sides. Instead of splitting the symbols of the grammar, we can modify the lexical entries as follows:
Engineering
1 answer:
koban [17]3 years ago
3 0

Answer:

The split is given by including spaces in both tabs

Explanation:

The bracket notation can be used to indicate the split. Here is an example:

String [ ] parts = s. split ( "[/]")

You might be interested in
Your Java program will be reading input from a file name strInput.txt. Each record contains String firstname String lastName Str
stiks02 [169]

Answer:

The program requires that you have the specified input files and it reads from each file at a time and processes salary in digits, states the city, state and bonus with respective first and last name as requested in the question. Note that you must have access to the mentioned output files for the program to work properly. Below is the java version of the program.

import java.io.File;

import java.io.FileNotFoundException;

import java.io.PrintWriter;

import java.util.Scanner;

class Driver

{

public static void main(String[] args) throws FileNotFoundException

{

Scanner sc = new Scanner(new File("strInput.txt"));

PrintWriter pd = new PrintWriter(new File("strOutputD"));

PrintWriter prf = new PrintWriter(new File("strOutputRF"));

String firstname = "", lastname = "", strSalary = "", status = "", cityState = "", city = "", state = "";

double salary = 0, bonus = 0;

int incorrectRecords = 0;

int dRecords = 0;

int fRecords = 0;

while(sc.hasNextLine())

{

firstname = sc.next();

lastname = sc.next();

strSalary = sc.next();

status = sc.next();

cityState = sc.next();

if(!status.equals("D") && !status.equals("F"))

{

System.out.println("Records is neither D nor F. Skipping this...");

incorrectRecords++;

continue;

}

else if(status.equals("D") || status.equals("F"))

{

char c = ' ';

int i = 0;

for(i=0; i<strSalary.length() && c != '.'; i++)

{

c = strSalary.charAt(i);

if(!Character.isDigit(c))

{

System.out.println("Char at position " + (i+1) + " in salary is not a digit");

incorrectRecords++;

continue;

}

}

if(c == '.')

{

if(i+1 == strSalary.length()-1)

{

if(!Character.isDigit(strSalary.charAt(i)))

{

System.out.println("Char at position " + (i+1) + " in salary is not a digit");

incorrectRecords++;

continue;

}

if(!Character.isDigit(strSalary.charAt(i+1)))

{

System.out.println("Char at position " + (i+1+1) + " in salary is not a digit");

incorrectRecords++;

continue;

}

}

else

{

System.out.println("Period is in the wrong position. Expected at " + (strSalary.length()-3) + " but found at " + (i+1));

continue;

}

}

city = cityState.split(",")[0];

state = cityState.split(",")[1];

salary = Double.parseDouble(strSalary);

if(status.equals("D"))

{

bonus = salary * 0.125;

dRecords++;

pd.write(firstname + " " + lastname + " " + status + " " + salary + " " + bonus + " " + city + " " + state);

}

else

{

bonus = salary * 0.18;

fRecords++;

prf.write(firstname + " " + lastname + " " + status + " " + salary + " " + bonus + " " + city + " " + state);

}

}

}

System.out.println("No of D records : " + dRecords);

System.out.println("No of F records : " + fRecords);

System.out.println("No of incorrect records : " + incorrectRecords);

}

}

6 0
3 years ago
Consider fully developed laminar flow in a circular pipe. If the viscosity of the fluid is reduced by half by heating while the
gladu [14]

Answer:

The pressure drop across the pipe also reduces by half of its initial value if the viscosity of the fluid reduces by half of its original value.

Explanation:

For a fully developed laminar flow in a circular pipe, the flowrate (volumetric) is given by the Hagen-Poiseulle's equation.

Q = π(ΔPR⁴/8μL)

where Q = volumetric flowrate

ΔP = Pressure drop across the pipe

μ = fluid viscosity

L = pipe length

If all the other parameters are kept constant, the pressure drop across the circular pipe is directly proportional to the viscosity of the fluid flowing in the pipe

ΔP = μ(8QL/πR⁴)

ΔP = Kμ

K = (8QL/πR⁴) = constant (for this question)

ΔP = Kμ

K = (ΔP/μ)

So, if the viscosity is halved, the new viscosity (μ₁) will be half of the original viscosity (μ).

μ₁ = (μ/2)

The new pressure drop (ΔP₁) is then

ΔP₁ = Kμ₁ = K(μ/2)

Recall,

K = (ΔP/μ)

ΔP₁ = K(μ/2) = (ΔP/μ) × (μ/2) = (ΔP/2)

Hence, the pressure drop across the pipe also reduces by half of its initial value if the viscosity of the fluid reduces by half of its value.

Hope this Helps!!!

4 0
3 years ago
Argue the importance to society of incorporating green building into an engineer's designs, with at least two examples.
stellarik [79]

Answer:

Green Design is your answer

Explanation:

4 0
2 years ago
Read 2 more answers
What type of foundation do engineers use for a small and light building and when the load of the building is borne by columns? A
ikadub [295]

Answer:

A.

Explanation:

Individual footings are the commonest, and they are often used if the load of the building is borne by columns. Typically, every column will have an own footing. The footing is usually only a rectangular or square pad of concrete on which the column is erected

8 0
2 years ago
The maximum voltage in a cooling system should not exceed ______ volts.
Natali [406]

Answer:2%

When the voltages between the three phases are not equal, the current increases dramatically in the motor winding's, and if allowed to continue, the motor will be damaged.

Explanation:

7 0
1 year ago
Other questions:
  • If a torque of M = 300 N⋅m is applied to the flywheel, determine the force that must be developed in the hydraulic cylinder CD t
    13·1 answer
  • What are the advantages of using 3D ink jet printing?
    10·1 answer
  • Mr.Haussman has 17 students in his class
    14·2 answers
  • According to Manor, the example of the subway train in New York City is an example of which type of uniqueness?
    9·1 answer
  • Description: Write a function that takes in a list of numbers and a list of indices. Note that indexList may not only contain va
    8·1 answer
  • Suppose that the voltage is reduced by 10 percent (to 90 VV). By what percentage is the power reduced? Assume that the resistanc
    10·1 answer
  • or a metal pipe used to pump tomato paste, the overall heat- transfer coefficient based on internal area is 2 W/(m2 K). The insi
    14·1 answer
  • If you owned a business, what are some of the ways you could follow green computing recommendations with regards to recycling an
    13·1 answer
  • If a car travels 8 miles in 15 minutes, what is the speed of the car in miles per hour
    11·1 answer
  • Developed an automated program in any language which take 12 dependent variable and corresponding independent variables and show
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!