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 does aux stand for on a car remote?
Charra [1.4K]
It means the sound cord, or axu is shot for auxiliary.
7 0
3 years ago
Read 2 more answers
PLZ BEEN STUCK ON THIS
Gnoma [55]

Answer:

am not really sure but between TCP/IP and data link am sorry for not being precise .

6 0
3 years ago
Read 2 more answers
Given a variable, polygon_sides, that is associated with a dictionary that maps names of polygons to number of sides, create a n
sveticcg [70]

Answer:

polygon_sides = {"Triangle" : 3,"Square" : 5}

n_polygons = {}

for key in polygon_sides:

   n_polygons[polygon_sides[key]] = key

print("Polygon sides: ", polygon_sides)

print("Names of polygons: ", n_polygons)

Explanation:

  • Initialize the polygon_sides dictionary.
  • Loop through polygon_sides dictionary and assign the associated names to n_polygons variable.
  • Display the polygon sides and the names of polygons.
3 0
3 years ago
The term “computer literacy” dates back to what decade? <br> 1960s<br> 1970s<br> 1980s<br> 1990s
NNADVOKAT [17]
1970-80s which is when some of the first computers were created like apple computers which looked like a giant cube and a rectangle on the side which is very different than what we have today.

Hope this helps!
3 0
4 years ago
You want to read about Web journals. which keywords would best help you find this information?
ololo11 [35]
The answer is (B) and (D) web or journal, <span>web Not journal


</span> Keyword is part of search engine optimization. Search engine optimization is not that heard. A keyword in a sentence is that significant word used to find info when doing your research.
Always, pick keywords that indicate main concepts of your topic. When searching, connect your keywords with Boolean values like AND, OR, and NOT





6 0
3 years ago
Other questions:
  • whats something that u want to do but ur parents wont allow it like having a phone or going to a college ​
    11·2 answers
  • What is the process of getting as many people as possible to visit your website called? A. Maximizing keyword potential B. Direc
    9·2 answers
  • What role do chromosomes play in inheritance?
    8·1 answer
  • if an open cut or wound is exposed to contamination washing it in hot water and hand soap is not sufficient to keep safe
    14·2 answers
  • Read the following sentences: “The Soviet Union’s famous launch of a satellite called Sputnik had been an embarrassment for the
    12·1 answer
  • A pre-design document you can use to create a new project quickly
    5·1 answer
  • A sum of money is shared between 2 friends in the ratio 2 : 3. If the larger
    9·1 answer
  • Select the correct answer.
    10·1 answer
  • Discuss the role of the concept behind the "Internet of Things (IoT)" in today's digitally connected society.
    11·1 answer
  • Describe the inter-relation and linkage in between traditional knowledge, indigenous knowledge and modern technology.​
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!