1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
yan [13]
3 years ago
8

how do you call the squares method to compute the first five squares and store the result in an array numbers

Computers and Technology
1 answer:
IRINA_888 [86]3 years ago
8 0

Answer:

The method can be called using:

int[] returnarray = Squares();

<em>Where returnarray represents the name of the array</em>

Explanation:

To answer this, I will make an assumption that the Square method is an int array method (i.e. it returns array).

So, to call the method from main, an array has to be declared to get the values:

int[] returnarray = Squares();

Then an iteration is created to iterate through the array in order to print the array elements.

for (int i = 0; i < returnarray.length; i++)

 System.out.print(returnarray[i]+ " ");    

-------------------------------------------------------------------------------------------

The answer ends here

-------------------------------------------------------------------------------------------

As an addition, the complete program that includes the method and the main is:

<em>public class Main{</em>

<em> public static int [] Squares(){</em>

<em>     int [] arr = new int[5]; </em>

<em>     for(int i = 1;i<6;i++){</em>

<em>         arr[i-1] = i*i;</em>

<em>     }</em>

<em>     return arr;</em>

<em> }</em>

<em> public static void main(String[] args) {</em>

<em>  int[] returnarray = Squares();</em>

<em>  for (int i = 0; i < returnarray.length; i++)</em>

<em>  System.out.print(returnarray[i]+ " ");          </em>

<em> }  </em>

<em>}</em>

You might be interested in
What is syntax?
kkurt [141]

Answer:

A

Explanation:

5 0
3 years ago
Jacob is a teacher and wants to sort his grades based on Test 1 and then on Test 2.
Pachacha [2.7K]
<span>He would click on the Test 1 column and press Sort, then click on the Test 2 column and press Sort. 
 It depends on what you learn because it says "shift"</span>
4 0
3 years ago
Read 2 more answers
HELP ME ASAP PLS BEING TIMED
kkurt [141]

Answer:

It would be considered cheating.

Explanation:

Any type of electronic use is considered cheating because you can look up the answers on the same phone or text someone for the answer. And so, Text messaging during a test is cheating because of the fact that is convenient to the cheater and not convenient to the teacher that is grading.

8 0
3 years ago
Read 2 more answers
A laptop computer communicates with a router wirelessly, by means of radio signals. the router is connected by cable directly to
Hoochie [10]
The answer would be 2500 Bits
4 0
3 years ago
How do you close a document but keep the word processing program open?
Zielflug [23.3K]

You open a new tab for word then close a other document

7 0
3 years ago
Read 2 more answers
Other questions:
  • Days of the week are represented as three-letter strings ("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"). Write a javaScript f
    14·1 answer
  • To use the Save As command, click on the __________tab to open the backstage view.
    13·1 answer
  • In Microsoft Word, spelling errors are identified by a _____.
    5·2 answers
  • Three variables, x, y and z, supposedly hold strings of digits, suitable for converting to integers. Write code that converts th
    13·2 answers
  • What are the three uses of a screw?​
    13·2 answers
  • I.d 9934607467<br> p.a.s.s 54321<br><br> P.L.E.A.S.E J.O.I.N. Z.O.0.M. M.E.E.T.I.N.G
    10·1 answer
  • Does digital media play a big role in your life?
    13·1 answer
  • Which of the following is not a common input device?
    6·1 answer
  • Giusp minfg gấp vs ạ đáp án thôi nhé
    15·1 answer
  • Hypertext enables you to navigate through pieces of information by clicking the __________, that connect them.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!