0% found this document useful (0 votes)
25 views1 page

Week 3 Assignment

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views1 page

Week 3 Assignment

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Week 3 assignment for Team Python

A. Create a CFG that can be used to validate the expression below.

𝑨 = (𝟓 ÷ 𝟕)𝟐 − (𝟖 × 𝟗)𝟑 + 𝟔

i. Draw the parse tree.


ii. Draw the abstract syntax tree.
B. Create a CFG for the if-elif-else statement in Python.
C. Design a Regular expression for 3-letter English words that start with the letter
‘c’.

Week 3 assignment for Team Java

A. Create a CFG that can be used to validate the expression below.

−𝒃 ± √𝒃𝟐 − 𝟒𝒂𝒄
𝒙=
𝟐𝒂
i. Draw the parse tree.
ii. Draw the abstract syntax tree.
B. Create a CFG for the switch statement in Java.
C. Design a Regular expression for 4-letter English words that start with the letter
‘b’ and end with the letter ‘n’.

You might also like