Ask Question

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?

+2
Answers (1)
  1. 28 September, 06:14
    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 & 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