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
gogolik [260]
3 years ago
12

. Question 1. Given the following grammar S → aAb | bBA A → ab | aAB B → aB | b and for each of the following right sentential f

orms, draw a parse tree and show the phrases, simple phrases and the handle. (15pt) (a) aaAbb (b) bBab (c) aaAbB b

Computers and Technology
2 answers:
Marianna [84]3 years ago
7 0

Answer:

Explanation

The following question refer to the grammar below,

S --> aAb | bBA

A --> ab | aAB

B --> aB |b

A) aaAbb

Parse Tree for question A

S

/ | \

a A b

/|\

a A B

|

b

Handles: b, aAB

Phrases: aaAbb, aaABb, aAb

Simple Phrase: b

B) bBab

PARSE TREE for question B.

S

/ | \

b B A

/ \

a b

Handles: ab

Phrases: bBab, bBA

Simple Phrase: ab

C) simple phrases:ab

Handle:ab

Phrases:aaaBb,aabB,ab

PARSE TREE for question C.

S

/ | \

a A b

/|\

a A b

/ \

a b

zmey [24]3 years ago
5 0

Answer:

Explanation:

(a) aaAbb (b) bBab (c) aaAbB b

The parse tree and phases are shown in the attached diagram below

You might be interested in
What is a sensitive compartmented information program
Dahasolnce [82]

Answer:

cpu

Explanation:

4 0
3 years ago
Define input hardware​
luda_lava [24]
It’s a piece of hardware (you can touch it) that changes something on the screen. Examples are a keyboard putting letters on the screen or a mouse moving the cursor
6 0
2 years ago
Assign a variable solveEquation with a function expression that has three parameters (x, y, and z) and returns the result of eva
larisa [96]

Answer:

<em>The programming language is not stated;</em>

<em>However, the program written in Python is as follows</em>

def solveEquation(x,y,z):

     result = z - y + 2 * x

     print(result)

x = float(input("x = "))

y = float(input("y = "))

z = float(input("z = "))

print(solveEquation(x,y,z))

Explanation:

This line defines the function solveEquation

def solveEquation(x,y,z):

This line calculates the expression in the question

     result = z - y + 2 * x

This line returns the result of the above expression

     print(result)

The next three lines prompts user for x, y and z

x = float(input("x = "))

y = float(input("y = "))

z = float(input("z = "))

This line prints the result of the expression

print(solveEquation(x,y,z))

3 0
3 years ago
Complete the sentence.<br><br> The internet is an example of a ___ .
worty [1.4K]
I’m going to assume it’s wan
3 0
2 years ago
In the Happy Valley School System, children are classified by age as follows:less than 2, ineligible2, toddler3-5, early childho
Greeley [361]

Answer:

int age = 10;

switch (age){

case 0:

case 1:

System.out.println("ineligible");

break;

case 2:

System.out.println("toddler");

break;

case 3:

case 4:

case 5:

System.out.println("early childhood");

break;

case 6:

case 7:

System.out.println("young reader");

break;

case 8:

case 9:

case 10:

System.out.println("elementary");

break;

case 11:

case 12:

System.out.println("middle");

break;

case 13:

System.out.println("impossible");

break;

case 14:

case 15:

case 16:

System.out.println("high school");

break;

case 17:

case 18:

System.out.println("scholar");

break;

default:

System.out.println("ineligible");

}

Explanation:

In java and many other programming languages, a switch statement is a way of having multiple branching options in a program. This is usually considered a more efficient way than using multiple if....else if statements. and the expression variables could be byte, char int primitive data types. etc. every branch (option) in a switch statement is followed by the break statement to prevent the code from "falling through". In the question The variable age is declared as an int and initialized to 10. and tested against the conditions given in the question.

7 0
3 years ago
Other questions:
  • USB keys can store terabytes of data. Of the five key factors that contribute to the increasing vulnerability of organizational
    13·1 answer
  • Which item refers to an illusion of figures and shapes in motion, which we commonly see in movies and video games?
    9·1 answer
  • Which scientific law states that if a light source radiates isotropically, the light intensity falls off the further you get fro
    5·1 answer
  • What addresses do not change if you copy them to a different cell?
    7·1 answer
  • A ____ operating system should be capable of supporting the applications and tools necessary to support Internet operations.
    10·1 answer
  • Int a=10 int b=20<br> A=b<br> The new values for a and b are
    11·2 answers
  • What are two major techniques involved in green computing
    14·1 answer
  • What is the point of brainy when other people have to answer your questions but not the cumputer
    9·1 answer
  • To what would you compare the transport layer?
    12·1 answer
  • If there are over 1,000 websites about a certain topic, the information is reliable. A. True B. False
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!