Ask Question
3 May, 22:54

Given a two-dimensional array named scores with double type elements, write the embedded loop to navigate this array and multiply each element in the array by 10, and put the embedded loop inside a method named increase, and the only parameter of this method is a double type two-dimensional array. This method increase should have void as its return type.

Required:

Write the one line of code to invoke the increase method inside main. Do you need to receive the return value of increase with a local variable, why or why not?

+4
Answers (1)
  1. 4 May, 02:26
    0
    Following are the code to this question:

    void increase (double scores[][]) / /defining method increase

    {

    //defining loop to multiply the value by 10

    for (int x=0; x
    {

    for (int y=0; y
    {

    scores[x][y]=scores[x][y] * 10; / /multiply value

    }

    }

    }

    increase (scores); / /call method and pass the value

    Explanation:

    Description to this question can be described as follows:

    In the above-given code, a method increase is declared, in which we pass a double array "scores", and inside the method two for loop is defined. Inside the loop an integer variable "x and y" is used, which multiply by 10 in the score array. In the next line method is called, that accepts array value, in this method calling we can't need to receive the return value because it increases, and it does require a void return type.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Given a two-dimensional array named scores with double type elements, write the embedded loop to navigate this array and multiply each ...” 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