39.1k views
0 votes
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

User Mshka
by
6.7k points

1 Answer

5 votes

Answer:

Following are the statements

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

Step-by-step 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 .
User Rdadolf
by
7.6k points