CSE 240 COMPREHENSIVE TEST SCRIPT
2026 QUESTIONS WITH SOLUTIONS 100%
CORRECT.
◍ Event-driven computing paradigm is to. Ans- define a set of events
and write an event handler for each event.
◍ If your program was designed to print "Hello World" ten (10) times,
but during execution, it printed eleven (11) times. What type of error is
it? Ans- Semantics Error
◍ Given this snippet of code in C,
char alpha = 'a';
int numeric = alpha + 10;
which of the following statement is correct: Ans- Syntactically correct,
but contextually incorrect.
◍ For the following BNF ruleset, which are terminal symbols? (Check
all that apply.)
,<char> ::= a | b | c | . . | x | y | z
<identifier> ::= <char> | <char> <identifer>. Ans- y, a
◍ Which commands (constructs) do NOT have a loop when expressed
in syntax graphs? Select all that apply. Ans- while (condition) do
{statements;}
if-then-else
for ( <init-expr>; <test-expr>; <increment-expr> ) {<statements>}
◍ If a program contains an error that divides a number by zero at the
execution time. This error is a. Ans- Semantic Error
◍ Given:
Very Simple Programming Language (VSPL)
<char> ::= a | b | c | . . | z | 0 | 1 | . . | 9
<operator> ::= + | - | * | / | % | < | > | == | >= | <=
<variable> ::= <char> | <char> <variable>
,<expr> ::= <variable> <operator> <variable> | ( <expr> ) <operator> (
<expr> )
<assign> ::= <variable> = <expr>;
<statements> ::= <assign> | <assign> <statements>
The following is valid:
myvar = (x + y) * (a - c);. Ans- true
◍ Given:
Very Simple Programming Language (VSPL)
<char> ::= a | b | c | . . | z | 0 | 1 | . . | 9
<operator> ::= + | - | * | / | % | < | > | == | >= | <=
<variable> ::= <char> | <char> <variable>
, <expr> ::= <variable> <operator> <variable> | ( <expr> ) <operator> (
<expr> )
<assign> ::= <variable> = <expr>;
<statements> ::= <assign> | <assign> <statements>
The following is valid:
a = x + y; b = s * t; c = w + v;. Ans- True
◍ Given:
Very Simple Programming Language (VSPL)
<char> ::= a | b | c | . . | z | 0 | 1 | . . | 9
<operator> ::= + | - | * | / | % | < | > | == | >= | <=
<variable> ::= <char> | <char> <variable>
<expr> ::= <variable> <operator> <variable> | ( <expr> ) <operator> (
<expr> )
<assign> ::= <variable> = <expr>;
<statements> ::= <assign> | <assign> <statements>
2026 QUESTIONS WITH SOLUTIONS 100%
CORRECT.
◍ Event-driven computing paradigm is to. Ans- define a set of events
and write an event handler for each event.
◍ If your program was designed to print "Hello World" ten (10) times,
but during execution, it printed eleven (11) times. What type of error is
it? Ans- Semantics Error
◍ Given this snippet of code in C,
char alpha = 'a';
int numeric = alpha + 10;
which of the following statement is correct: Ans- Syntactically correct,
but contextually incorrect.
◍ For the following BNF ruleset, which are terminal symbols? (Check
all that apply.)
,<char> ::= a | b | c | . . | x | y | z
<identifier> ::= <char> | <char> <identifer>. Ans- y, a
◍ Which commands (constructs) do NOT have a loop when expressed
in syntax graphs? Select all that apply. Ans- while (condition) do
{statements;}
if-then-else
for ( <init-expr>; <test-expr>; <increment-expr> ) {<statements>}
◍ If a program contains an error that divides a number by zero at the
execution time. This error is a. Ans- Semantic Error
◍ Given:
Very Simple Programming Language (VSPL)
<char> ::= a | b | c | . . | z | 0 | 1 | . . | 9
<operator> ::= + | - | * | / | % | < | > | == | >= | <=
<variable> ::= <char> | <char> <variable>
,<expr> ::= <variable> <operator> <variable> | ( <expr> ) <operator> (
<expr> )
<assign> ::= <variable> = <expr>;
<statements> ::= <assign> | <assign> <statements>
The following is valid:
myvar = (x + y) * (a - c);. Ans- true
◍ Given:
Very Simple Programming Language (VSPL)
<char> ::= a | b | c | . . | z | 0 | 1 | . . | 9
<operator> ::= + | - | * | / | % | < | > | == | >= | <=
<variable> ::= <char> | <char> <variable>
, <expr> ::= <variable> <operator> <variable> | ( <expr> ) <operator> (
<expr> )
<assign> ::= <variable> = <expr>;
<statements> ::= <assign> | <assign> <statements>
The following is valid:
a = x + y; b = s * t; c = w + v;. Ans- True
◍ Given:
Very Simple Programming Language (VSPL)
<char> ::= a | b | c | . . | z | 0 | 1 | . . | 9
<operator> ::= + | - | * | / | % | < | > | == | >= | <=
<variable> ::= <char> | <char> <variable>
<expr> ::= <variable> <operator> <variable> | ( <expr> ) <operator> (
<expr> )
<assign> ::= <variable> = <expr>;
<statements> ::= <assign> | <assign> <statements>