CSCI 461 Exam Questions With 100%
Verified Answers
Which of the following can be the root of a grammar parse tree?
a non-terminal symbol
a production
a start symbol
a token -
correct answer ✅a non-terminal symbol
Given the following grammar:
<S> ::= <NP> <V> <NP>
<NP> := <A> <N>
<V> := loves | chases | eats
<N> := dog | cat | rat
<A> := a | the
"the cat hates the dog" is a sentence (i.e <S>) (" " not included)
True
,CSCI 461 Exam Questions With 100%
Verified Answers
False -
correct answer ✅False
Which of the following of a production means that the something
inside can be repeated any number of times (zero or more)?
<something>
{ something }
(something)
[something] -
correct answer ✅{ something }
The ________________ of a programming language defines what
the program's behavior and meaning is. -
correct answer ✅semantics
Which of the following has unique parse tree for expression a+b+c
with meaning of (a+b)+c?
,CSCI 461 Exam Questions With 100%
Verified Answers
<exp> ::= <exp> + <var> | <var>
<var> ::= a | b | c
<exp> ::= <var> + <exp> | <var>
<var> ::= a | b | c
<exp> ::= a | b | c | <exp>+<exp> -
correct answer ✅<exp> ::= <exp> + <var> | <var>
<var> ::= a | b | c
Which of the following is postfix notation?
+ab
ab+
a+b
(a+b == 2)? x:y; -
correct answer ✅a b +
, CSCI 461 Exam Questions With 100%
Verified Answers
Based on the following grammar, what is the meaning of expression
a + b*c**a?
<exp> := <exp> + <exp> | <powexp>
<powexp> ::= <powexp> ** <powexp> | <mulexp>
<mulexp> ::= <mulexp> * <mulexp> | (<exp>) | a | b | c
((a+b)*c)**a
a+((b*c)**a)
a+(b*(c**a)) -
correct answer ✅a+((b*c)**a)
The act of associating properties with names is called
_________________
assignment
Verified Answers
Which of the following can be the root of a grammar parse tree?
a non-terminal symbol
a production
a start symbol
a token -
correct answer ✅a non-terminal symbol
Given the following grammar:
<S> ::= <NP> <V> <NP>
<NP> := <A> <N>
<V> := loves | chases | eats
<N> := dog | cat | rat
<A> := a | the
"the cat hates the dog" is a sentence (i.e <S>) (" " not included)
True
,CSCI 461 Exam Questions With 100%
Verified Answers
False -
correct answer ✅False
Which of the following of a production means that the something
inside can be repeated any number of times (zero or more)?
<something>
{ something }
(something)
[something] -
correct answer ✅{ something }
The ________________ of a programming language defines what
the program's behavior and meaning is. -
correct answer ✅semantics
Which of the following has unique parse tree for expression a+b+c
with meaning of (a+b)+c?
,CSCI 461 Exam Questions With 100%
Verified Answers
<exp> ::= <exp> + <var> | <var>
<var> ::= a | b | c
<exp> ::= <var> + <exp> | <var>
<var> ::= a | b | c
<exp> ::= a | b | c | <exp>+<exp> -
correct answer ✅<exp> ::= <exp> + <var> | <var>
<var> ::= a | b | c
Which of the following is postfix notation?
+ab
ab+
a+b
(a+b == 2)? x:y; -
correct answer ✅a b +
, CSCI 461 Exam Questions With 100%
Verified Answers
Based on the following grammar, what is the meaning of expression
a + b*c**a?
<exp> := <exp> + <exp> | <powexp>
<powexp> ::= <powexp> ** <powexp> | <mulexp>
<mulexp> ::= <mulexp> * <mulexp> | (<exp>) | a | b | c
((a+b)*c)**a
a+((b*c)**a)
a+(b*(c**a)) -
correct answer ✅a+((b*c)**a)
The act of associating properties with names is called
_________________
assignment