Assume that arithmetic is a reference to an object that has a method named add , that accepts two int arguments and returns their sum .

Two int variables , euroSales and asiaSales , have already been declared and initialized . Another int variable , eurasiaSales , has already been declared .

Write a statement that calls add to compute the sum of euroSales and asiaSales and that stores this value in eurasiaSales

Respuesta :

Answer:

Following are the statements

eurasiaSales = arithmetic.add(euroSales, asiaSales); //calls to the add function

Explanation:

Following are the description of the statement.

  • Declared a variable euroSales, asiaSales of "int" type.
  • As given in the question "arithmetic" is a reference type variable that is used to call the method "add".
  • arithmetic.add function is calling the function "add" . In this function we pass the two integer values into it.
  • Finally "eurasiaSales"  is used to store the result of calling arithmetic.add (euroSales, asiaSales) function .