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
kap26 [50]
3 years ago
14

What method of the Math object can be used to return the largest value from the values that are passed to it?

Computers and Technology
1 answer:
miss Akunina [59]3 years ago
7 0

Answer:

the Math.max() method

Explanation:

The java.lang.* package contains all the essential components needed for a JAVA program which involves numbers and all the operations done on the numericals.

The java.lang.math class contains all the methods needed to perform mathematical operations on numerical values.

All the methods in the question are discussed below with examples.  

Math.max() method

java.lang.Math.max(double/ int/ float a, double/ int/ float b)

This method returns the highest value from among the parameters passed to it.

The syntax for the above is  

Numbers can be integers, float and double or long. The return type is the same as the parameters.

Two values to be compared are passed as arguments and the higher value of them is returned.

This function also accepts negative integers as parameters.

Math.max(-9, -2);

Gives -2 as the output.

Math.max(0.34, 0.45)

Gives 0.45 as the output.

Math.ceil() method

java.lang.Math.ceil(double/ int/ float a)  

This method returns the nearest greater whole number for the given number.

Integer parameter returns an integer number.

Math.ceil(7);

Gives 7 as the output.

Decimal number will return the nearest higher integer.

Math.ceil(8.7);

Gives 9.0 as the output.

Math.ceil(-0.34)

Gives -0 as the output.

Math.pow() method

java.lang.Math.pow(double/ float/ int a, double/ float/ int b)

The above method returns the result of a raise to the power of b.

The first parameter is the base while the second parameter forms the exponent.

Math.pow( 2.3,  4.5 );

This calculates (2.3)^4.5.

Gives 42.44‬ as the output.

Math.pow( 2, 3 );

This calculates the value of 2^3.

Gives 8 as the output.

Math.abs() method  

java.lang.Math.abs(double a)

This method returns non-negative value of the numerical parameter passed to it. Absolute of a number does not changes its value but changes the sign of a negative number. It returns the positive or negation of the negative input number.

Math.abs(-0.1234)

Gives 0.1234 as the output.

Math.abs(12.34)

Gives 12.34 as the output.

These methods require java.lang.Math to be imported in the program.

You might be interested in
Need Help Please
erastova [34]

Answer:

1. siblings + 1

2. numberOfPizzas * pizzaCost

3. alienGreeting + alienGreeting2

4. color1 === color2

5. value1 - value2

6. console.log(gradeAverage === gradeAverage2)

7. numberToString + numberToString2

8. numberOfStudents / numberOfClassrooms

9. console.log(carSpeed === truckSpeed)

4 0
2 years ago
Which of the following is a characteristic of the internet today? distributed network central hub lack of protocols absence of c
Bingel [31]
The answer should be distributed network. 
8 0
3 years ago
Detecta 1 problema
Komok [63]

Answer:

En el factor secundario el problema es la contaminación ambiental y (o) polución.

Explanation:

No solo dentro de las industrias, si no que en todos lados...

Una manera de contrarrestar este problema es reducir el uso de recursos no renovables y utilizar los renovables. En forma de ahorro, los no renovables se podran producir un poco mas y podriamos mantener un buen ciclo de uso.

Espero te sirva!!

3 0
2 years ago
Read 2 more answers
You designed a program to create a username using the first three letters from the first name and the first four letters of the
Pavel [41]

Answer:

See Explanation

Explanation:

The question would be best answered if there are options to select from; since none is provided, I will provide a general explanation.

From the question, we understand that, you are to test for Jo Wen.

Testing your program with this name will crash the program, because Jo has 2 letters (3 letters are required), and Wen has 3 letters (4 letters are required)

So, the step that needs to be revisited is when the username is generated.

Since the person's name cannot be changed and such person will not be prevented from registering on the platform, you need to create a dynamic process that handles names whose lengths are not up to the required length.

7 0
2 years ago
Drag the tiles to the correct boxes to complete the pairs.
sertanlavr [38]

Answer:

Explanation:

IaaS - storage and network devices

SaaS - software upgrades and patches

MaaS - monitoring tools

PaaS - virtual computing platform

7 0
2 years ago
Other questions:
  • What is the operating system?
    9·1 answer
  • What do you believe are the motives of a cyber criminal? Why?
    15·1 answer
  • When a user runs an application, what transfers from a storage device to memory?
    8·1 answer
  • All of the nested folders you created will carry the same permissions as the __________ until you make changes.
    10·1 answer
  • Which increases the rate of soil formation?
    10·1 answer
  • What is an example of a memo
    9·1 answer
  • To check if your operating system is up to date, click Start then click Control Panel and choose _______________. Select one: a.
    11·1 answer
  • Vpn stands for _____. very precise settings virtual private network virtual public network vice prestigious setup
    5·1 answer
  • A ___ is an online collaborative event that may include such features as chat, slideshows, and PowerPoint presentations.
    8·1 answer
  • What option in the zone aging/scavenging properties dialog box will prevent dns record time stamps from being updated too often?
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!