subject

40 POINTS In Java PLS The Extremes class represents the range of Integer values.

Fill in the Extremes methods. In the constructor, set min and max to the minimum and maximum value of Integer. Use Integer. MIN_VALUE and Integer. MAX_VALUE. Also fill in the minDiff and maxDiff methods to return the difference between the users guess and the actual max/min values of Integer.

Main
In main, use the comments as a guide to ask the user to guess the maximum and minimum values. Compute the difference between the guess and the values, then print it out.

Be aware that if you choose a number too big or too small, it will cause an error since the number cannot be stored.

The results in main should look something like this:

Guess the maximum Integer value:
543214
You were off by 2146940433
Guess the minimum Integer value:
2145678321
You were off by 1805327

Main:
import java. util. Scanner;
import java. lang.*;

public class ExtremeMain
{
public static void main(String[] args)
{
// Create a Scanner object

// Create an Extremes object

// Ask the user to guess the maximum value of an Integer

// Compute and display the difference
// between the max and the guess

// Ask the user to guess the minimum value of an Integer

// Compute and display the difference
// between the min and the guess

}
}

Extreme Class:

public class Extremes
{
Integer min;
Integer max;

// Constructor
public Extremes()
{
//Set min and max values
}

// Returns the difference
// max - number
public Integer maxDiff(Integer number)
{

}

// Returns the difference
// min - number
public Integer minDiff(Integer number)
{

}

// Returns a String representation
// in the form
// [min, max]
public String toString()
{
return "[" + min + ", " + max + "]";
}
}

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 06:20
What is a point-in-time measurement of system performance?
Answers: 3
question
Computers and Technology, 23.06.2019 17:30
Scientists have changed the model of the atom as they have gathered new evidence. one of the atomic models is shown below. what experimental evidence led to the development of this atomic model from the one before it? a few of the positive particles aimed at a gold foil seemed to bounce back. the colors of light emitted from heated atoms had very specific energies. experiments with water vapor showed that elements combine in specific proportions. cathode rays were bent in the same way whenever a magnet was brought near them.
Answers: 2
question
Computers and Technology, 23.06.2019 18:30
Janice recently received her college degree and is looking for a job. she is worried that since she just finished school, she will be required to repay her perkins and direct subsidized loans immediately. janice pulls out the paperwork she signed and reviews it again for repayment information. after reading all of the information, janice discovers that
Answers: 2
question
Computers and Technology, 24.06.2019 05:30
If you combine two cells into one, what action are you performing? a.  adding a new row or column      b.  splitting the cells      c.  removing a new row or column      d.  merging the cells
Answers: 2
You know the right answer?
40 POINTS In Java PLS The Extremes class represents the range of Integer values.

Fill i...
Questions
question
English, 01.09.2020 18:01
question
Mathematics, 01.09.2020 18:01
question
Geography, 01.09.2020 18:01
question
History, 01.09.2020 18:01
question
Mathematics, 01.09.2020 18:01
Questions on the website: 13722367