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
Help on What i should say to my IT school lady? Read all three pages
avanturin [10]

Answer:

if you were to rest my would I still be able to have all my stuff that I have done if so I think you could reset it for me

hope this helps

have a good day :)

Explanation:

4 0
3 years ago
Which of the following are parts of the Physical Layer?
Snowcat [4.5K]

Answer:

Physical layer is the first layer of OSI model.  The detail about physical layer and its parts is given below in explanation section.

Explanation:

The physical layer is the lowest and first layer of the Open Systems Interconnection Model (OSI). The physical layer is used for the transmission of data in bit forms. For transmission of data between devices, it uses the transmission medium that is either wired or wireless.

In the wired cable the component of the psychical layer include cable and connectors that are implemented for carrying data from one place to another or simply to transmit data between two connected devices. The wireless transmission medium is used to transmit data in the form of electromagnetic signals for carrying data into a stream of bits. Over past advancements in networking technologies, rapid growth has been seen in wireless data transmission and Wi-Fi and Bluetooth communication are few names of it.

Components/Parts of Psychical Layer

In the physical layer, the hardware components used it in are the network interface cards, connectors and interfaces, intermediate devices, modems, and cables to facilitate the transmission of data between devices or from source to destination.

  • The network interface card (NIC)

NIC is a component installed in the computer to connect it to any available devices over the network.

  • Connectors and Interfaces

Connectors and interfaces are used to connect cables that are being used for transmission of data from one source to another. The decision to choose connectors and interfaces depends on the type of cable. Typical examples are RJ-45, RJ-11, V.35, HDMI, etc.

  • Cables

Cables are the physical components of the physical layer that carry optic or electromagnetic signals for transmission of data from source to destination in the network.

  • Intermediate devices

The intermediate devices are hubs and repeaters etc. The functions of these devices are to amplify or generate the signal at the intermediate point in a network.

6 0
4 years ago
In a contract, what is consideration
Mrac [35]
Do you wan the definition ?
3 0
3 years ago
Explain LCD and give two example​
Pani-rosa [81]

Answer:

LCD means least common denominator• a "Common Denominator" is when the bottom number is the same for the fractions.

Explanation:

3 0
3 years ago
Read 2 more answers
Consider your lab assignment when reviewing the following code that will be placed in the CopyingJeroo class: public void atFlow
Mice21 [21]

Answer:

The image would be created on the second island and removed from the first island.

3 0
4 years ago
Other questions:
  • Hardware- The ______________ equipment that makes up the computer.
    6·1 answer
  • An example of live footage is when?
    10·2 answers
  • Use the variables k and total to write a while loop that computes the sum of the squares of the first 50 counting numbers, and a
    10·1 answer
  • What is encyclopedia. Com considered to be?
    14·1 answer
  • Vertebrates first arrived during the _________________.
    9·1 answer
  • Which is a good guideline to follow for adding animation to a presentation?
    12·1 answer
  • What is the term for a set of actions carried out on inputs?
    7·1 answer
  • Describe PROM, EPROM and EEPROM memories​
    7·1 answer
  • State the advantages of MS Excel in data encoding
    9·1 answer
  • What year does futurist ray kurzweil believe ai will meet human intelligence?.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!