Beruflich Dokumente
Kultur Dokumente
2
Name: Andrew A. Juarez
Score:__________________
Expression.
String.
2. What are the operators used in relational expressions?
-
(>), greater than or equal to (>=), equal to (==) and not equal
to (/=).
3. How the arithmetic expression is evaluated?
-
If
type as long as both parts of the expression have the same basic
data type.
5. How the Logical Expressions are evaluated?
-
Each
Algorithm
Instead,
b. Boolean
c. String
b. Boolean
c. String
b. Boolean
c. String
b. 3+4
c.4-2
b.34%2
c.9+4
b. real numeric
c. Integer
b. False
c. None
b. 5
c. five
b. 125.0
c. 125.00
b. False
C. Exercises
None
Let:
A = 5
B = 1.0
C=3
1.) D = (A+B) * C
D = (5 + 1.0) * 3
D = 6.0 * 3
D = 18.0
2.) D = (A + B) * C/2 % 1
D = (5 + 1.0) * 3/2 % 1
D = 6.0 * 1
D = 6.0
3.) D = B * C + 3 / 2 A
D
D
D
D
=
=
=
=
1.0 * 3 + 3/2 A
3.0 + 1.5 5
4.5 5
-0.5
4.) D = B * 2 + 3 * A (A%2)
D
D
D
D
=
=
=
=
1.0 * 2 + 3 * 5 5%2
2.0 + 15 2
17.0 2
15.0
5.) A < B
5 < 1.0
FALSE
6.) (A + B < C)
5 + 1.0 < 3
6 < 3
FALSE
7.) D = (A * B) + C / ( 4 + 3)
D = (5 * 1.0) + 3 / (4 + 3)
D = 9 / 7
D = 1.29
D=C