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]
2 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]2 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
Based on current and upcoming gaming technologies, what changes do you expect to see in the next generation of gaming consoles?
damaskus [11]
Better graphics getting 1080 p easily running on 240 frames and a higher storage so then you could have more games on the console
4 0
3 years ago
When measuring an unknown voltage with an analog VOM, you should first A. ground the circuit. B. set the switch to the lowest ra
ale4655 [162]

<u>Answer:</u>

The correct answer option is D. set the switch to the highest range and then move it to a range that gives the most accurate reading.

<u>Explanation:</u>

When measuring an unknown voltage with an analog VOM, one should set the meter to the highest range and then move it to a range that gives the most accurate reading.

The reason being that the analog meters indicate the measurement of voltage by moving a needle  across a physical card by printing numbers on it.

So in case the voltage is nearly 100 times the full range to which the meter is set,  then its needle will try move to a position which will be 100 times the highest number on the meter.

3 0
3 years ago
Time shifting occurs when
Aleksandr-060686 [28]
Answer: C

Time shifting is when you move from one period in time to another.
4 0
3 years ago
Read 2 more answers
when I was playing Mobile legends bang bang online Match The game logged Me out and when I was Trying To reconnect it failed and
Helen [10]

Answer:

it's most prolly a bug.The game crashes a lot tbh

5 0
3 years ago
Explain the importance of understanding plagiarism, copyright, and fair use during a time when some much of your schoolwork is d
kow [346]

Answer:

Firstly, it is unethical because it is a form of theft. By taking the ideas and words of others and pretending they are your own, you are stealing someone else's intellectual property. Secondly, it is unethical because the plagiariser subsequently benefits from this theft.

Explanation:

I hope this helps! Have a good day.

8 0
3 years ago
Other questions:
  • Which loan type requires you to make loan payments while you’re attending school?
    10·1 answer
  • He smallest network is a ______________________, which is a network of personal devices, such as the network you use when you sy
    5·1 answer
  • A collection of information stored in an electronic format that can be searched by a computer.
    14·1 answer
  • Which statement best describes a transition in PowerPoint?
    12·1 answer
  • ............................... ?
    11·1 answer
  • Chapter 15 Problem 6 PREVENTIVE CONTROLS Listed here are five scenarios. For each scenario, discuss the possible damages that ca
    11·1 answer
  • Select the correct answer.
    15·2 answers
  • Software that enables the organization to centralize data is called A. Data Repository B. Data Base Management System C. Data Wa
    6·1 answer
  • Help please match them if you just put a link or say “I don’t know but thanks for the points” I’ll report your answer and you wo
    10·1 answer
  • Write A Code In Python
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!