static void findmiddle ( int A , int X , int n ) {
  int i , j , aPow , xPow ;
  float middleTerm1 , middleTerm2 ;
  if ( n % 2 == 0 ) {
    i = n / 2 ;
    aPow = ( int ) Math . pow ( A , n - i ) ;
    xPow = ( int ) Math . pow ( X , i ) ;
    middleTerm1 = ( ( float ) factorial ( n ) / ( factorial ( n - i ) * factorial ( i ) ) ) * aPow * xPow ;
    System . out . println ( "MiddleTerm = " + middleTerm1 ) ;
  }
  else {
    i = ( n - 1 ) / 2 ;
    j = ( n + 1 ) / 2 ;
    aPow = ( int ) Math . pow ( A , n - i ) ;
    xPow = ( int ) Math . pow ( X , i ) ;
    middleTerm1 = ( ( float ) factorial ( n ) / ( factorial ( n - i ) * factorial ( i ) ) ) * aPow * xPow ;
    aPow = ( int ) Math . pow ( A , n - j ) ;
    xPow = ( int ) Math . pow ( X , j ) ;
    middleTerm2 = ( ( float ) factorial ( n ) / ( factorial ( n - j ) * factorial ( j ) ) ) * aPow * xPow ;
    System . out . println ( "MiddleTerm1 = " + middleTerm1 ) ;
    System . out . println ( "MiddleTerm2 = " + middleTerm2 ) ;
  }
}

static void findmiddle ( int A , int X , int n ) { int i , j , aPow , xPow ; float middleTerm1 , middleTerm2 ; if ( n % 2 == 0 ) { i = n / 2 ; aPow = ( int ) Math . pow ( A , n - i ) ; xPow = ( int ) Math . pow ( X , i ) ; middleTerm1 = ( ( float ) factorial ( n ) / ( factorial ( n - i ) * factorial ( i ) ) ) * aPow * xPow ; System . out . println ( " MiddleTerm ▁ = ▁ " + middleTerm1 ) ; } else { i = ( n - 1 ) / 2 ; j = ( n + 1 ) / 2 ; aPow = ( int ) Math . pow ( A , n - i ) ; xPow = ( int ) Math . pow ( X , i ) ; middleTerm1 = ( ( float ) factorial ( n ) / ( factorial ( n - i ) * factorial ( i ) ) ) * aPow * xPow ; aPow = ( int ) Math . pow ( A , n - j ) ; xPow = ( int ) Math . pow ( X , j ) ; middleTerm2 = ( ( float ) factorial ( n ) / ( factorial ( n - j ) * factorial ( j ) ) ) * aPow * xPow ; System . out . println ( " MiddleTerm1 ▁ = ▁ " + middleTerm1 ) ; System . out . println ( " MiddleTerm2 ▁ = ▁ " + middleTerm2 ) ; } }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier)) declarator: (variable_declarator name: (identifier)) declarator: (variable_declarator name: (identifier)) declarator: (variable_declarator name: (identifier))) (local_variable_declaration type: (floating_point_type) declarator: (variable_declarator name: (identifier)) declarator: (variable_declarator name: (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (decimal_integer_literal))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (integral_type) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (identifier))))))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (integral_type) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (binary_expression left: (parenthesized_expression (binary_expression left: (cast_expression type: (floating_point_type) value: (method_invocation name: (identifier) arguments: (argument_list (identifier)))) right: (parenthesized_expression (binary_expression left: (method_invocation name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (identifier)))) right: (method_invocation name: (identifier) arguments: (argument_list (identifier))))))) right: (identifier)) right: (identifier)))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (string_literal) right: (identifier)))))) alternative: (block (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (decimal_integer_literal)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (decimal_integer_literal)))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (integral_type) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (identifier))))))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (integral_type) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (binary_expression left: (parenthesized_expression (binary_expression left: (cast_expression type: (floating_point_type) value: (method_invocation name: (identifier) arguments: (argument_list (identifier)))) right: (parenthesized_expression (binary_expression left: (method_invocation name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (identifier)))) right: (method_invocation name: (identifier) arguments: (argument_list (identifier))))))) right: (identifier)) right: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (integral_type) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (identifier))))))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (integral_type) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (binary_expression left: (parenthesized_expression (binary_expression left: (cast_expression type: (floating_point_type) value: (method_invocation name: (identifier) arguments: (argument_list (identifier)))) right: (parenthesized_expression (binary_expression left: (method_invocation name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (identifier)))) right: (method_invocation name: (identifier) arguments: (argument_list (identifier))))))) right: (identifier)) right: (identifier)))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (string_literal) right: (identifier))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (string_literal) right: (identifier)))))))))