Ask Question
17 August, 12:49

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.

+4
Answers (1)
  1. 17 August, 13:06
    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?
Find 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 the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers