Performing Calculations Flashcards
A programmer’s tools for performing calculations
Math operators
Performs a calculation and gives a value
Math expression
The values on the right and left of the + operator
Operands
Operator that performs floating-point division
/
Operator that performs integer division
//
When two operators share an operant, the operator with the higher ___ is applied first.
Precedence
Adds two numbers
+
Subtracts one number from another
-
Multiplies one number by another
*
Divides one number by another and gives the remainder
%
Raises a number to a power
**
What is the end value of the following expression?
5 + 2 * 3
13
What is the end value of the following expression?
10 / 2 - 3
2
What is the end value of the following expression?
8 + 12 * 2 - 4
28
What is the end value of the following expression?
6 - 3 * 2 + 7 - 1
6