Math Operators
Learning Objectives
In addition to all previous competencies, upon completion of this unit, you should be able to:
- Understand and properly use math operators
- Correctly apply operator precedence
- Understand and properly use compound operators
- Understand and properly use the modulo operator
Unit Learning Activities
In this unit you get started with the basics of applying math in programming. You will also learn about compound operators, operator precedence and using the modulo operator. The techniques learned in these chapters are fundamental concepts which you will build upon to create complex applications. Fear not! You do not need to be a math wiz to understand these concepts. Each link below takes you to a specific chapter within this unit.
“Anyone who has never made a mistake has never tried anything new.” -Albert Einstein
- Additive Operators
- Printing to the Console
- The Additive Operators
- Adding
- Subtracting
- Combining Operators
- What You Learned
- Multiplicative Operators
- The Multiplicative Operators
- Multiplying
- Dividing in Java
- Combining Operators
- What You Learned
- Operator Precedence
- Native Order of Precedence
- Understanding the Order of Precedence
- Changing the Order of Precedence with Parentheses
- Operator Precedence and Dividing in Java
- What You Learned
- Test Your Knowledge - Interactive activity
- Compound Assignment Operators
- Compound Assignment Operators
- Adding into a Variable
- Subtracting into a Variable
- Multiplying into a Variable
- Dividing into a Variable
- What You Learned
- Modulo Operator
- The Modulo Operator
- How Modulo Works
- What You Learned