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
Question 3
prohojiy [21]

The Answer Should Be:

<u>The first thing for you to do when you arrive at an intersection is to stop at the traffic light. Your going to want to listen to the instructions or signals of the traffic Police.</u>

I Hope This Helps? :)

8 0
3 years ago
Data stored in computer systems has a high value because there is a great deal of time and effort that goes into creating an ana
Andrew [12]

Answer:

Data often has intrinsic value.

Explanation:

Data stored in computer systems has a high value because there is a great deal of time and effort that goes into creating an analyzing it and data often has intrinsic value.

5 0
3 years ago
PLEASE HELP ME!!!!!
gizmo_the_mogwai [7]

Answer:

Unicode

Explanation:

This is a fairly large code and Is well known throughout my family since we study ancient codex and modern codes to solve crimes and find relics of the past, although our research has proven good and unicode is one that is being studied currently now, I have found it as long and very time consuming. Although ASCII is a computer code that consists of graphs and numbers it actually shortens the text. and hexadecimal has been proven to be less reliable and binary is a short code with little symbols

8 0
3 years ago
Read 2 more answers
By applying styles,____ formats are being applied each time?
Ray Of Light [21]
(A) the same, by applying styles the same formats are being applied each time.
8 0
3 years ago
How does sugar dissolve in water ? &amp; Read Carefully ?
Degger [83]
Depends

such as if the molecule in the water is hot then the molecules of the sugar would dissolve faster since the hot water speeds the process.

Cold water molecules would be slower since of course its slows down the reaction when sugar is applied.
8 0
3 years ago
Other questions:
  • Pedestrians, cyclists, horse drawn vehicles and wheel chair users are known as ___________
    6·2 answers
  • Fair use allows individuals to break copyright so long as they ________.
    15·1 answer
  • What is the recommended solution to configure this automated behavior? UC has a requirement that an opportunity should have a fi
    8·1 answer
  • Suppose we provide a new implementation of the transport layer protocol tcp providing the same functionality using different alg
    14·1 answer
  • Write a method that will receive 2 numbers as parameters and will return a string containing the pattern based on those two numb
    10·1 answer
  • A server provides the necessary IP configuration to your network host so the host can communicate on the network. If this servic
    7·1 answer
  • Which of the following data structures can erase from its beginning or its end in O(1) time?
    15·1 answer
  • What does BGP use by default to calculate the best route?
    15·1 answer
  • Challenge activity 1.11.1: using constant in expression is not working for me. Can any one help me find the right code?
    12·1 answer
  • The database cannot be migrated to a different engine because sql server features are used in the application’s net code. The co
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!