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
Which of the following is not an operating system a) boss b) window xp c) linux d) bindux​
zmey [24]

Answer:

boss is not an os

Explanation:

boss is a former of Linux hope this helped

5 0
3 years ago
A user is claiming a host can be reached via the IP address but not through the name. What should a technician do first to resol
bagirrra123 [75]

Answer:

Add an entry to the HOSTS file

Explanation:

A file that is used to add the host name along with their IP addresses is called Host file. In this file all the IP addresses are mapped with their respective host names. Whenever some user tries to access some website, he may use the name of website to access it. The website have both name and IP address of the server, both of these information stored in host file. On GUI the user only see the information of Host name.

If some user only access the IP address of the website instead of the host name. The technician should add the name and IP address of the host in Host file. He should follow the following steps to resolve the problem.

  1. Access the host file by following the given path of file in Windows operating system.
  2. open the host file
  3. edit the file with new host name and relevant IP address
  4. save the changes

3 0
4 years ago
Use the ________ property in the html link tag to to associate a web page with a style sheet for printing.
lawyer [7]
You should use the <span>media="print" link tag to achieve this. </span>
8 0
3 years ago
Create a program that allows the user to input a list of first names into one array and last names into a parallel array. Input
natita [175]

Answer:

The program in Python is as follows:

firstName = []

lastName = []

while True:

   fName = input("First Name: ")

   lName = input("Last Name: (Enter to quit): ")

   if not lName:

       break

   firstName.append(fName)

   lastName.append(lName)

for i in range(len(firstName)):

   print(firstName[i] . lower()+"."+lastName[i] . lower()+" mycollege . edu")

Explanation:

See attachment for complete source file where comments are used as explanation

Download txt
8 0
3 years ago
In which scenario would instant messaging be more useful than other forms of communication?
ivann1987 [24]
When you're busy doing things and/or be too sick for over the phone communication
7 0
3 years ago
Other questions:
  • Describe the indicators and hazards of a metal deck roof fire in an unprotected steel joist warehouse as well as the techniques
    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
  • What Software is used to play,create, and modify audio and video files
    7·2 answers
  • Which of the following is not a commodity?<br>A. Crude oil<br>B. Corn dogs<br>C. Cocoa<br>D. Coffee​
    10·2 answers
  • Write a program that lets the user enter a nonnegative integer then uses a loop to calculate the factorial of that number. Displ
    11·1 answer
  • Calculate the change in RGDP if the MPC is .6 and initial spending is $500,000.
    8·1 answer
  • IN WHICH COUNTRY DO THEY LET YOU PLAY MINECRAFT IN SCHOOL?
    8·2 answers
  • The first version of Windows to have automatic updates from the Internet was _____.
    13·1 answer
  • Explain why people struggle to control themselves when they engage with social media
    15·2 answers
  • In additon to setting up services, what other tasks does a sysadmin have to keep in mind? check all that apply.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!