1.
Which of the following can be treated as a Boolean expression?
A. an int expression
B. any of these
C. the result of a comparison(such as <or>)
D. a float expression
2. Assuming the variable x contains an integer value what will
the result of the following statement be: if x<0 or
x>=0.
A. True
B. False
C. Sometimes true and sometimes false
D. A "math domain" error will occur
Following is an infix expression.
((A ^ B) ^ C ^ M * W / X ) ^ Y ^ Z
Convert it into postfix and prefix using stack and verify
through binary tree.
Evaluate infix, postfix and prefix with the following
values.
A = 2, B = 2, C = 3,
M = 1, W = 4, X = 8, Y = 1, Z = 3
Unix / Linux
16.
Regular Expression:
Given the following regular expression, provide a description of
the intended match.
^[^A-Z]
17.
Regular Expression:
Given the following regular expression, provide a description of
the intended match.
[^^!]
18.
Regular Expression:
Given the following regular expression, provide a description of
the intended match.
^.\{72\}$
19.
Regular Expression:
Given the following regular expression, provide a description of
the intended match.
[A-Za-z0-9]
20.
Regular Expression:
Given the following regular expression, provide a description of
the...
Evaluate the following logical expression. Choose True if the
expression evaluates to true; choose False if the expression
evaluates to false.
(3 * 5 > 10) || (20 < 15)
True
False
Evaluate the following logical expression. Choose True if the
expression evaluates to true; choose False if the expression
evaluates to false.
"Medium" < "High"
True
False
Evaluate the following logical expression. Choose True if the
expression evaluates to true; choose False if the expression
evaluates to false.
(4...
2. Convert the following infix form expression into the postfix
form expression by using a stack:
A+(B*(C-D)+E)/F-G*H
Show the stack after each push/pop.
java
Convert the following Infix expression to a Postfix expression.
Show all work
Infix
Expression
Stack
Postfix Expression
----------------------------------------------------------------------------------------------------------------------------
8 - 9*(2 + 1/4) +
3*7
(empty)
(blank)
Evaluate the following Postfix expression. Once again, show all
work.
Postfix
Stack
Result
---------------------------------------
-------------------- --------------
2 7 +
12 4 / * 8 5 + -
Consider the following regular expression meta operators:
( ) [ ] { } . * + ? ^ $ | \
For each of the following, give one example of strings which the
regular expression would match.
Describe (colloquially, in a manner that a non-technical person
would understand) the set of strings that the pattern is designed
to match.
Each regular expression is enclosed in the pair of '/'
characters below.
[2 marks each]
(a) /^[a-z][0-9]*\.$/
(b) /([0-9]+)\s\w+\s\1/
Define a regular expression in JAVA for the following
An "Ent" is an at sign '@', followed by one or more
decimal
digits '0' through '9' or uppercase letters 'R' through 'W',
followed by an octothorpe sign '#'