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 was the history of technology since the 1980s to now and how is it used in classrooms?.?. PLEASE HELP
levacccp [35]

Answer:

Please check the explanation.

Explanation:

The US education department mentioned that in 1900 there were only 10% of students enrolled in the schools, however by the end of 1992, the percentage increased by 85% and it became 95%. In 1930 1 million students were enrolled in university. And by 2012, it became 21.6 million. The teachers began to follow a new type of teaching, and the academics began to follow a special method for communique, education as well as for helping the students understand the concepts.

Though, after the 1980s the personal computer came into being in schools and colleges. Since then numerous versions of PC have originated in the marketplace as well as mobiles tracked by Smartphones, and now nearly 100% of people in the US have smartphones. Virtual reality, augmented reality, AI, Machine learning. etc. has cemented the way for the virtual classrooms. Also, each subject is now up with fruits and not just-food. The consequence is such a delightful setup of the Virtual schoolrooms in the entire US, and all over the ecosphere. The projectors, VR devices, AI applications for education, online classroom facility, Electronic version of chalkboards, and in fact everything is no sophisticated, and it is making not only teaching easy but learning as well. And the result is, students are ending up with better results, and teachers seem to be happier and more relaxed. And that is making school management satisfied as well.

3 0
3 years ago
How to remove negative feedback on amazon?
Svetlanka [38]
1. go back to the feedback you submitted
2.Locate the order, and then click remove 
3.select a reason for the removal and click to remove the feedback button.

(But why would you write a rude comment in the first place to begin with?)
3 0
3 years ago
Which of the following may businesses use to screen out applicants for a position? A. social media B. applications C. resumes D.
Nataly_w [17]
The correct answer is E
8 0
3 years ago
Read 2 more answers
You just finished training a decision tree for spam classification, and it is gettingabnormally bad performance on both your tra
strojnjashka [21]

Answer:

Option B is the correct option.

Explanation:

The following answer is true because when the person completed our training of a decision tree and after the following presentation he getting not good working performance on both side i.e., test sets and during the training period. After the training there is no bug on the implementation of the presentation then, he has to increase the rate of the learning.

5 0
3 years ago
Which of the following is not a legal identifier?
Paraphin [41]

Answer:

321Go

Explanation:

The identifiers in C, C++, C#, Java and other programming languages are a combination of letters, numbers and the underscore symbol.  The laters versions of C and C++ allows you to use almost all Unicode characters. In Java, you can use also the dollar sign.

From that you have to be careful to follow these rules:

-Don't use keywords.

-Don't include white spaces.

-Don't use operators.

-Don't repeat identifiers.

-Don't start your identifier with a number.

-Don't use two consecutive underscores.

So app_234, happyTimesAhead, and cis22B are follo wing these rules but 321Go starts with a number.

4 0
3 years ago
Other questions:
  • Digital cameras are less susceptible to UV light.Select one of the options below as your answer:A. TrueB. False
    15·2 answers
  • Less than 40 percent of teens have used marijuana within the past year. True or false?
    8·1 answer
  • Shelby likes to play video games on an old Atari video game system. No matter how old the cartridge, when she inserts it into th
    14·2 answers
  • Given: The following if statement uses an overloaded &gt; operator to determine whether the price of a Car object is more than $
    5·1 answer
  • Which of the following is not a main function within end user support?
    13·1 answer
  • Variables set equal to patterns are said to be:_______.
    7·1 answer
  • Is it better to meet online or offline<br> (Please answer QUICK)<br><br> Thanks :')
    5·2 answers
  • ____ software is rights-protection software used to control the use of a work.
    9·1 answer
  • The image below shows an encoding for a black and white pixel image. The first two
    13·1 answer
  • HELP PLEASE
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!