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
xz_007 [3.2K]
2 years ago
10

Write a java program as follows Write a method called powOfTwo that takes an integer as parameter, computes, and outputs it’s sq

uare
Computers and Technology
1 answer:
Kisachek [45]2 years ago
8 0

Answer:

public static int powOfTwo(int input) {

 return input*input;

}

You will have to call this method in main
for printing it, write

System.out.println(powOfTwo(your number));

in public static void main(str[]args) {

}

You might be interested in
What do you think about the argument that word processing reduces the quality of writing?
slava [35]
<span>I believe when you're given a sufficient amount of time you are able to write your thoughts clearly than when you're given a short period of time to answer questions or make an argument on an essay BUT there is a drawback with the tools within the word processing. Word processing comes with a spell check but it does not correct homonyms such as they're, their and there or other homonyms. My experience with word processing is that I always need time to effectively write something and that helps me make less grammatical mistakes when I take my time to write and edit my paper, I guess it all depends on the individual in their writing skills

I hope this helps!
</span>
5 0
4 years ago
Consider the following code: String word [] = {"algorithm", "boolean", "char", "double"}; for ( int i =0; i &lt; word.length/2;
KiRa [710]

Answer:

{"double", "char", "char", "double"} will be stored in word.

Explanation:

Given the word is an array of four strings,  {"algorithm", "boolean", "char", "double"}. Hence, the length of the word array is 4.

The for-loop will only run for two iterations due to i < word.length/2, with i = 0 (first loop) and i = 1 (second loop).

In the first loop,  

  • word[word.length - 1 - i]  =  word[4 - 1 - 0]  = word[3]  = "double"
  • Hence, the string "double" will be assigned to word[0] and overwrite "algorithm"

In the second loop,

  • word[word.length - 1 - i]  =  word[4 - 1 - 1]  = word[2]  = "char"
  • Hence, the string "char" will be assigned to word[1] and overwrite "boolean"

At last, the word array will hold {"double", "char", "char", "double"}

8 0
4 years ago
Read 2 more answers
Which of the following ways is NOT one of the ways that the census is
Liono4ka [1.6K]

Answer: By internet

Explanation:

5 0
3 years ago
Jorge is sending a large image file to a friend as part of a shared classroom project. Which of the following is most likely tru
madreJ [45]

Answer:

D. The image will require fewer bits in order to be represented.

Explanation:

Lossy compression algorithms are typically better than lossless compression algorithms at reducing the number of bits needed to represent a piece of data.

5 0
3 years ago
If a device does not require a driver, it is _____.
xxTIMURxx [149]

Answer:

(B) plug and play

Explanation:

If a device does not require a driver, it is <u>plug and play</u>. Plug and Play (PnP) is a combination of hardware and software support that enables a computer system to recognize and adapt to hardware configuration changes with little or no intervention by a user, including the loading of appropriate drivers.

7 0
4 years ago
Other questions:
  • What is scientific and​
    13·2 answers
  • Question 3 / 5
    9·1 answer
  • The operating system is not directly involved in one of these tasks.Immersive Reader
    12·1 answer
  • The domains of the risk IT framework mutually inform each other, creating flexibility and agility. It is possible to uncover a p
    10·1 answer
  • An argument is different from a parameter in that an argument
    11·2 answers
  • A_______is a limitation imposed on the engineer. It can be a limitation on
    5·1 answer
  • In critical thinking, an argument is:
    12·2 answers
  • As a sports store owner, the higher the price you charge for gear...
    8·2 answers
  • Why would you browse by entering a URL rather than use a link in a Web page
    15·1 answer
  • PA theme is a major message that a writer convoys through a text. you have explored many themes in the hobbit one theme in the n
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!