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, 22.06.2019 16:00
Why should characters such as / \ " ' * ; - ? [ ] ( ) ~ ! $ { } < > # @ & | space, tab, and newline be avoided in file names?
Answers: 2
question
Computers and Technology, 23.06.2019 15:00
Idon’t understand the double8 coding problem. it is java
Answers: 1
question
Computers and Technology, 23.06.2019 21:30
Examine the list below. which factors positively affect lifetime income? check all that apply.
Answers: 1
question
Computers and Technology, 24.06.2019 17:00
Aman travel 200m towards east< br /> from his house then takes left< br /> to turn and moves 200 m north< br /> find the displacement & distance.< br />
Answers: 3
You know the right answer?
40 POINTS In Java PLS The Extremes class represents the range of Integer values.

Fill i...
Questions
question
Mathematics, 05.08.2021 22:10
question
Mathematics, 05.08.2021 22:10
question
Mathematics, 05.08.2021 22:10
Questions on the website: 13722359