Ask Question
17 March, 02:07

Add is a function that accepts two int parameters and returns their sum.

Two int variables, euro Sales and asia Sales, have already been declared and initialized. Another int variable, eurasia Sales, has already been declared.

Write a statement that calls add to compute the sum of euro Sales and asia Sales and store this value in eurasia Sales.

+2
Answers (1)
  1. 17 March, 02:50
    0
    Solution code is written in Java.

    public static void main (String[] args) { int eurasiaSales = Add (10000, 20000); } public static int Add (int euroSales, int asiaSales) { return euroSales + asiaSales; }

    Explanation:

    Firstly, create a function Add () that takes two int parameters, euroSales and asiaSales. This function return the sum of euroSales and asiaSales (Line 5-6).

    Next, we can simply call the function by passing two integers (place them in parenthesis). The returned value from the function will be assigned to variable eurasiaSales.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Add is a function that accepts two int parameters and returns their sum. Two int variables, euro Sales and asia Sales, have already been ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers