VB Lecture Notes - Evaluating Expressions
Objective #1: Evaluate mathematical expressions.Use the order of operations to evaluate expressions and to write proper expressions.
- is the negative sign
^ is the exponent operator. For example, 2 ^ 3 evaluates to 8 since 2 to the third power is 8. 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. It computes the remainder of a division problem. For example, 10 Mod 3 evaluates to 1 since the remainder of 10 divided by 3 is 1. Examples: 12 Mod 5 = 2 4 Mod 3 = 1 4 Mod 2 = 0 10 Mod 10 = 0
+ is the addition operator
- is the subtraction operator
Objective #2: Use the order of operations to evaluate expressions.
Objective #3: Write proper mathematical expressions.
2 * 10 / 5 + 4
10 / 5 * 2 + 4
which both simplify to 8