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
Many major employers routinely monitor the performance of their employees through the computers and telephones they use. Employe
STALIN [3.7K]

Answer:

Employers are allowed to check the number of keystrokes that word processors enter during the day.

Explanation:

An employer is authorized to monitor the activity of its employee when:

  • The employee authorizes it.
  • The employer owns the system to be used.
  • Surveillance is necessary for a strictly professional purpose.

By analyzing the keys pressed per day, the employer can determine the performance provided by its employees, and if they use the company's resources, for non-work purposes.

5 0
3 years ago
Cotización de un software
Mashcka [7]

Answer:

translate it

Explanation:

3 0
3 years ago
In what way do networks help to protect data
Aleksandr-060686 [28]

One way that computer networks help to protect data is by backing up the data.

Computer networks are normally formatted to automatically back up all of the data that is stored on them. This protects the data in case of any type of computer system failure.

5 0
3 years ago
10 sentences about computer parts.
Ahat [919]
One computer part is the CPU, it’s a piece of hardware the last allows your computer to access and interact all the applications and programs. The first ever CPU chip was invented around 4 decades ago. The keyboard is another computer part and it allows the user to type letters and numbers. There are about 104 keys on a keyboard and there are different parts in it. Some of the parts include, control keys, function keys, navigation keys, numeric keypad, and so on. A mouse is another device used with the keyboard to position the cursor. It’s a hand held device that detects two-dimensional motion relative to a surface. This motion is typically translated Into the motion of a pointer on a display, which allows a smooth control of the graphical user. Memory is a device to store all of your information and saved data. The motherboard is the backbone that tied together the computers components at one spot.
6 0
2 years ago
Is(are) input value(s) to use with a program to test the accuracy of the output.
Law Incorporation [45]

Answer:

test cases

Explanation:

5 0
3 years ago
Read 2 more answers
Other questions:
  • Compare and contrast the TwoFish encryption algorithm with the DES and AES algorithms. In your comparison be sure to compare and
    6·1 answer
  • You have been asked to create an authentication security plan for your company. Which of the following components would you inco
    14·1 answer
  • EBay buyers voluntarily comment to other users and sellers on the quality of service, promptness of shipping, and their general
    5·1 answer
  • Never mind I got it
    8·2 answers
  • We want to construct a memory with 256 bytes in capacity. Assume that each byte has a unique address. (a) How many address lines
    14·1 answer
  • In Java Write a program that prompts the user for a name (any String value would work for testing), and print a hello message to
    15·1 answer
  • What can use so tha the slides can appear?
    13·1 answer
  • On most desktop computers, most of the USB ports are on the back of the computer case. Generally, you'll want to connect your mo
    13·1 answer
  • The introduction of new information technology has a: A. dampening effect on the discourse of business ethics. B. waterfall effe
    14·1 answer
  • Someone plz answer
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!