1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to Java

Connected

Exercise

Performing calculations

Math is at the heart of programming - from simple addition to complex formulas. Java provides operators that let you perform calculations just like you would with a calculator. Let's put these operators into action!

Instructions

100 XP
  • Save the result of 5 plus 6 into the int called varA.
  • Save the result of varA minus 3.5 into the double called varB.
  • Save the result of 3 times 3 into the int called varC.
  • Save the result of varC divided by 3 into the int called varD1 and also to a double called varD2.