Using Math.max and/or Math.min, write a class MaxOrMin, and make sure touse Math.max and Math.min which does the following: a. Create a Scannerb. Declare two variables, number1 and number 2c. Ask the user to enter 2 numbersd. Using the information above, print messages displaying the highest and lowest values ora message if the numbers are equal. The messages should look like the sample outputbelow Tip• Use if-else statement Submission• Copy and paste your code• Screen shot the console with user input of three examples Sample Run Enter a number 5Enter a number 9The lowest value is 5The highest value is 9 Enter a number 24Enter a number 11The lowest value is 11The highest value is 24 Enter a number 12Enter a number 1212 and 12 are equal

Question

Using Math.max and/or Math.min, write a class MaxOrMin, and make sure to
use Math.max and Math.min which does the following:

a. Create a Scanner
b. Declare two variables, number1 and number 2
c. Ask the user to enter 2 numbers
d. Using the information above, print messages displaying the highest and lowest values or
a message if the numbers are equal. The messages should look like the sample output
below

Tip
• Use if-else statement

Submission
• Copy and paste your code
• Screen shot the console with user input of three examples

Sample Run


Enter a number 5
Enter a number 9
The lowest value is 5
The highest value is 9

Enter a number 24
Enter a number 11
The lowest value is 11
The highest value is 24

Enter a number 12
Enter a number 12
12 and 12 are equal

Expert Answer

1 Rating

Want to see the step-by-step answer?

See Answer

Check out a sample Q&A here.

Want to see this answer and more?

Experts are waiting 24/7 to provide step-by-step solutions in as fast as 30 minutes!*

See Answer
*Response times vary by subject and question complexity. Median response time is 34 minutes and may be longer for new subjects.

Related Computer Science Q&A

Find answers to questions asked by student like you
Show more Q&A

Q: Consider the following two assertions. Assume x is a specific but unknown real number.a. x < 2 o...

A: Let us name the statements as following:For expression (a)A: x < 2B: Not(1 < x < 3)so the e...

Q: need help with understanding how to do the SQL code for the following question:  These are the heade...

A: As the table name is not shown in the picture, we are assuming the table name as Product. There are ...

Q: // java // book is starting out with java //chapter 12  (5)Theater RevenueA movie theater only keeps...

A: Program plan:Import required packages.Define a class named “TheatreGUI”.Declare the required variabl...

Q: create a python program that will ask users to input four different manufacturers of cars(e.g Ford, ...

A: Create a class Car and define _init_ () function which will initialize the value of variables manufa...

Q: A pet shop wants to give a discount to its clients if they buy one or more pets and at least four ot...

A: The program has two main parts – the part which receives the input and the part which validates the ...

Q: Write a class, AgeMessages , which does the following:a. Ask the user to enter age using a Scannerb....

A: The given below is the code to enter the age through user and print the message according to age. To...

Q: Hi,please I need to use Python for the following: Use for loop to do the following: 1) print the num...

A: Program instructions:Use range() in for loop to print the numbers.Function range() has here argument...

Q: Prove that the following languages are not regular: (b) L = {anblak : k ≠ n + l}.

A: First, assume the given language is regular.Then apply pumping lemma to prove the statement is not r...

Q: Create a recursive store function called add_numbers to calculate the total of all consecutive posit...

A: As there is no specific programming language mentioned, so we are creating this program in C program...