Ask Question
16 November, 14:26

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.

+1
Answers (1)
  1. 16 November, 18:23
    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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers