Math Expression Exercises: (DO ALL 8
PROBLEMS FOR BOTH SETS OF EXERCISES)
EXERCISE SET 1: Provide the correct result by
evaluating the following expressions:
Consider the variable A to have the constant value of
5 and B to have the constant value of 8.
1. 8 +
5 - 3 _______________________
2. 5 -
6 * 3 _______________________
3. 9 /
3 + A - 2 _______________________
4. 4 +
(6 * A - 3) - 2 _______________________
5. B *
3 - 7 _______________________
6. B *
(3 - 7) _______________________
7. (4
* 2) / (3 - -1) _______________________
8. (A+
A + 50) / 3 *
(B - A) _______________________
EXERCISE SET 2: Assigning Values to Variables:
What are the values of A and B after these sequences
of assignments? Note: there is only one
value allowed in a variable at a time.
Old values are erased by each new assignment.
1)
A = 5
B = 6
A = B A:___________ B:________________
2)
A = 7
B = 18
A = B – 9 A:___________ B:________________
3)
B = 5
A = 5
A = B – A
B = A A:___________ B:________________
4)
A = 0
B = A
A = 17 A:___________ B:________________
5)
A = 10
B = 5 + A * 2
A = 11 A:___________ B:________________
6)
A = 0
B = 4
A = B – A * 8 A:___________ B:________________