The "(int)" casts the result of the equation to an integer value. So, the variable result is an integer however the expression contains all doubles. The "(int)" takes the answer to the expression and turns it into an int that can be stored in result.