VB Lecture Notes - Assignment Statements
Objective #1: Use assignment statements to calculate and store mathematical results and to change the properties of objects.
dblRate = 0.035
dblInterest = dblPrincipal * dblRate * intTime
strName = "John Doe"
REMEMBER, DO NOT CODE THE FOLLOWING: x + 8 = y which is "backwards" as an assignment statement.
Objective #2: Use the order of operations to evaluate expressions and to write proper expressions.
9 + intNum - 12
(intGame1 + intGame2 + intGame3) / 3
- is the negative sign
^ is the exponent operator in VB (for example, 2 ^ 3 evaluates to 8 since 2 to the third power is 8). Since few other computer languages allow the ^ to be used as the exponent operator, later in this course, you will learn how to use the Pow method from the Math class to perform exponentiation.
* is the multiplication operator
/ is the division operator
Mod is the modulus operator. The modulus operator finds the remainder of a division problem. For example, 10 Mod 3 evaluates to 1 since the remainder of 10 divided by 3 is 1. Other examples are 12 Mod 5 is 2, 4 Mod 3 is 1, 4 Mod 2 is 0, 10 Mod 10 is 0.
+ is the addition operator
- is the subtraction operator
dblFahr = 9 * dblCel / 5 + 32
dblFahr = 9 / 5 * dblCel + 32
Objective #3: Know how to set break points, examine values of variables and expressions in the Watch window, and single-step through programs.