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
Sergio039 [100]
3 years ago
14

Write a method getIntVal that will get the correct value input as integer numbers from the user. The input will be validated bas

ed on the first two numbers received as parameters. In other words, your program will keep asking for a new number until the number that the user inputs is within the range of the and . The method should show a message asking for the value within the range as:
Computers and Technology
1 answer:
Setler [38]3 years ago
4 0

Answer:

 import java.util.Scanner;

public class Main

{  

   //Create a Scanner object to be able to get input

   public static Scanner input = new Scanner(System.in);

   

public static void main(String[] args) {

    //Ask the user to enter the lowest and highest values

    System.out.print("Enter the lowest: ");

    int lowest = input.nextInt();

    System.out.print("Enter the highest: ");

    int highest = input.nextInt();

   

    //Call the method with parameters, lowest and highest

    getIntVal(lowest, highest);

}

//getIntVal method

public static void getIntVal(int lowest, int highest){

    //Create a while loop

    while(true){

        //Ask the user to enter the number in the range

        System.out.print("Enter a number between " + lowest + " and " + highest + ": ");

        int number = input.nextInt();

       

        //Check if the number is in the range. If it is, stop the loop

        if(number >= lowest && number <= highest)

            break;

        //If the number is in the range,

        //Check if it is smaller than the lowest. If it is, print a warning message telling the lowest value

       

        if(number < lowest)

            System.out.println("You must enter a number that is greater than or equal to " + lowest);

        //Check if it is greater than the highest. If it is, print a warning message telling the highest value

        else if(number > highest)

            System.out.println("You must enter a number that is smaller than or equal to " + highest);

    }

}

}

Explanation:

*The code is in Java.

You may see the explanation as comments in the code

You might be interested in
virtue by which you need to secure information by limiting computer access to authorized personnel only
Natalka [10]
I don't get what you are trying to ask...
Please explain
6 0
3 years ago
Can we draw a formula triangle for velocity?​
mafiozo [28]

Answer:

Yes we can actually draw a formula triangle for velocity

Explanation:

I can't explain why but if u wanna calculate the velocity of something using a diagram then you will draw a trapezium and in that trapezium there are two triangles and a rectangle so you will split it into two triangles and trapezium so I think we can actually draw a formula triangle for velocity

4 0
4 years ago
The design activity key question, "how will this system interact with other systems..." is part of which design activity?​
nika2105 [10]
Re their answer choices

3 0
4 years ago
What pattern is a heart-shaped pattern that captures sound from a single direction, ?from the front?
STatiana [176]

Answer:

The pickup diagram for the Cardioid (heart-shaped) microphone pattern tells you is that the microphone is most sensitive to sound coming in from the front (where the blue arrow is), and will tend to “refuse” sound coming in from the other side (the red arrow points to that part).

Explanation:

5 0
3 years ago
61. Select an activity of the Production Phase: a. a web authoring tool is often used b. the graphics, web pages, and other comp
Elodia [21]

Answer:

d. all of the above.

Explanation:

Since the advent of digital technology, production of goods and services have experienced a significant change from the traditional methods of production. This paradigm shift is made possible by the application of various modern technology.

Production processes are generally being facilitated and enhanced by the use of;

1. Computer-integrated manufacturing (CIM).

2. Computer-aided process planning (CAPP).

3. Computer-aided design (CAD).

4. Computer numerical control (CNC).

In the process of selecting an activity of the production phase:

1. A web authoring tool is often used.

2. The graphics, web pages, and other components are created.

3. The web pages are individually tested.

7 0
3 years ago
Other questions:
  • What is MARC? Discuss structure of MARC
    8·1 answer
  • Write a program that defines an interface having the following methods: addition, subtraction, multiplication, and division. Cre
    8·1 answer
  • What is a segment
    12·1 answer
  • List and explain the error in the code
    14·1 answer
  • Write a program that lets a maker of chips and salsa keep track of their sales for five different types of salsa they produce: mi
    8·1 answer
  • Helping people keep track on things is the purpose of_____ A database B table C query D form​
    12·1 answer
  • In 4-bit two's complement representation, what is the binary encoding of the number -5?
    8·1 answer
  • Can someone tell me? I have an assignment in C++: I have to do three codes please tell me should i do them in one project or in
    12·1 answer
  • With SQL, how do you select all the columns from a table named "Persons"?
    8·1 answer
  • the human resources department requests a list that contains the number (i.e. count) of orders taken on each date, grouped by th
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!