Cd206 Business Programming: (Tutorial 3) (L3B-4
Cd206 Business Programming: (Tutorial 3) (L3B-4
End Sub
End Class
A variable is a data item whose value can change during the program's execution.
Thus, as its name implies – the value can vary. E.g. customer’s name, price, width
Initialization: it's a special kind of assignment: the first. Before initialization objects
have null value and primitive types have default values such as 0 or false. Can be
done in conjunction with declaration.
Assignment: throwing away the old value of a variable and replacing it with a new
one
12- Evaluate the following expressions. Show evaluation steps in your answer.
(i) (45 + 2^2 \ 15) Mod 5 – 2
= (45 + 4 \ 15) Mod 5 -2
= (45 + 0) Mod 5 – 2
= 45 Mod 5 – 2
=0–2
= -2
(ii) (5 \ 2 + 3 / 2) >= 3 AND false
(5 \ 2 + 1.5) >= 3
(2 + 1.5) >= 3
3.5 >= 3 AND false
TRUE AND FALSE
FALSE
13- Differentiate between Explicit and Strict options in VB.net. State the default value for
each option.
c. x = (3 * 9 * (3 + (9 * 3 / (3))))
= (3 * 9 *(3 + (27 / 3)))
= (3 * 9 * (3 + 9))
= (27 * (12))
x = 324
d. x = 6 * 2 ^ 3 + 4 / 2
=6*8+2
x = 50
e. x = 6 / 2 * 2 ^ 3 + 4
=6/2*8+4
=3*8+4
x = 28
16- Given z = 8e5-n write in VB expression.
z=8*e^5–n
END OF QUESTION