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
Ivanshal [37]
2 years ago
15

How to square a number in java.

Computers and Technology
1 answer:
artcher [175]2 years ago
8 0

Answer:

num**2

Explanation:

To square a number in Java, you just take the number and use two asterisks (**) to denote an exponent, and then connect a 2 to it.

For example, if your number is 5:

5**2 in Java means 5^2, which is 25.

Just like how 5**3 in Java means 5^3.

Hope this helps.

You might be interested in
Match the organelles to their functions.
noname [10]

Answer:

I. Smooth endoplasmic reticulum.

II. Golgi apparatus.

III. Lysosomes.

IV. Nucleus.

Explanation:

A cell can be defined as the fundamental or basic functional, structural and smallest unit of life for all living organisms. Some living organisms are unicellular while others are multicellular in nature.

A unicellular organism refers to a living organism that possess a single-cell while a multicellular organism has many (multiple) cells.

Generally, cells have the ability to independently replicate themselves. In a cell, the "workers" that perform various functions or tasks for the survival of the living organism are referred to as organelles.

Some examples of cell organelles with their respective functions in all living organisms such as trees, birds, and bacteria include;

1. Nucleus : it controls all the activities taking place in the cell and the synthesis of proteins. Thus, it's the organelle that commands other organelles.

2. Mitochondria : it provides all the energy required in the cell by transforming energy forms.

3. Lysosomes : they are responsible for absorbing materials and breaking the materials taken in by the cells. Thus, it digests foreign material.

4. Chromosomes : they give sets of instructions for the synthesis of products.

5. Ribosomes : they are involved in the build up of proteins.

6. Smooth Endoplasmic Reticulum : this is where the ribosomes perform their tasks. Thus, it produces lipids and fats.

7. Cytoskeleton : they help to maintain and support the shape of the cells.

8. Vesicles : they ensure proteins are properly transported to the right and exact location.

9. Golgi apparatus : it prepares the protein for export by chemically tagging them. Also, this organelle produces lysosomes.

10. Cell membrane : is the wall of the cell and typically controls what leaves and enters the cell.

7 0
3 years ago
Why do you think that so many of these sources have similar names?
Anon25 [30]

Answer:

What sources? WILL ANSWER in comments

4 0
3 years ago
Help me plssssss which rule should be followed to stay safe online
max2010maxim [7]

Answer:

B: Avoid Sharing Photos

Explanation:

If you send a photo to a person, you need to be very careful not to send something that can give your information away, this includes but it not limited to Pictures of your town, Pictures of You, Pictures of Friends, Pictures of Family, etc.

Hope I could help!!

7 0
3 years ago
Read 2 more answers
In JAVA, answer the following:
erica [24]

Answer:

The JAVA program is as follows.

import java.util.Scanner;

public class Program

{

   static int n;

public static void main(String[] args) {

    //scanner object

    Scanner stdin = new Scanner(System.in);

    //loop executes till number entered is in the range of 1 to 10

    do

    {

        System.out.print("Enter any number: ");

        n = stdin.nextInt();

    }while(n<1 || n>10);

    System.out.println("Number is valid. Exiting...");

}

}

OUTPUT

Enter any number: 0

Enter any number: 23

Enter any number: 10

Number is valid. Exiting...

Explanation:

The program is explained.

1. The integer variable, n, is declared static since the variable should be accessible inside main() which is static.

2. An object of Scanner, stdin, is created inside main().

3. Inside do-while loop, the user is asked input any value for n.

4. The loop continues till user inputs a number which is not in the given range, beginning from 1 to 10.

5. The loop will not be terminated till the user enters a valid input.

6. Once a valid input is entered, the message is displayed to the console and the program ends.

7. The variable, n, is declared at the class level and is a class variable. Class variables are declared inside the class but outside all the methods in that class.

8. Since JAVA is a purely object-oriented language, all the code is written inside class.

9. The object of class is not created since only one class is included in the program. If more than one class is included, then the object of the class which does not has the main() method will be created inside main().

10. User input for integer is taken via scanner object and using nextInt() method.

11. The methods, print() and println() display the messages to the console. The only difference is that println() inserts a new line after displaying the message.

12. The name of the class having main() and the name of the program should be the same.

7 0
3 years ago
Write code that read from variables N and M, multiply these two unsigned 32-bit variables and store the result in Variables P, Q
Tamiku [17]

Answer:

Using C language;

#include <stdio.h>

int main()

{

int N, M;

printf("Please enter two numbers: ");

scanf("%d %d", &N, &M);

int P,Q = N*M;

return 0;

}

Explanation:

The variables N and M are declared and the "scanf" function is used to assign a value to the variables from the input prompt, then the product of N and M are saved to the P and Q variables.

8 0
3 years ago
Other questions:
  • c++ design a class named myinteger which models integers. interesting properties of the value can be determined. include these m
    14·1 answer
  • What is the slogan of the sociological school of criticism ?​
    9·1 answer
  • Using the media as equipment for living. Explain how you would use some form of media to serve a purpose in your life—and what t
    6·2 answers
  • Please Help!
    14·2 answers
  • What will be the output after the following code is executed? def pass_it(x, y): z = y**x return(z) num1 = 3 num2 = 4 answer = p
    7·1 answer
  • PLEASE HELP I WILL GIVE YOU BRAINLILY
    15·2 answers
  • Camera work is at the center of video production. True or False?
    14·1 answer
  • CHOOSE THE CORRECT CONTINUOUS TENSES( PRESENT CONTINUOUS,PAST CONTINUOUS AND FUTURE CONTINUOUS) : 1. I saw a snake while I _____
    10·1 answer
  • Sự ra đời của thương mại điện tử có tác động như thế nào đến việc quảng cáo và Marketing sản phẩm
    11·2 answers
  • The underlying color of a slide.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!