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
Vadim26 [7]
3 years ago
12

Write a program that checks whether a positive number given by an input from the user is greater than 5 and less than 20 with ja

va in eclipse. Output the result.
Computers and Technology
1 answer:
Alona [7]3 years ago
5 0

Answer:

Program written in Java is as follows

See comments for explanations

import java.util.Scanner;

public class CheckRange {

public static void main (String [] args)

{

// This line allows the program accept user input

Scanner input = new Scanner(System.in);

//This line declares variable for user input

int num;

//This line prompts user for input

System.out.print("Number: ");

//This line gets user input

num = input.nextInt();

/* The following if statement checks if the user input is greater than 5 and less than 20 */

if (num > 5 && num <= 20)

{

/* This line is executed if the above condition is true */

System.out.print(num+" is greater than 5 and less than 20");

}

else

{

/*If the condition is not true, this line is executed*/

System.out.print(num+" is not within specified range");

}

// The if condition ends here

}

}

You might be interested in
The backbone networks of the Internet are typically owned by long-distance telephone companies called
Aneli [31]

Answer:

network service providers

Explanation:

The backbone networks of the Internet are typically owned by long-distance telephone companies called network service providers.

A network service provider can be defined as a business firm or company that is saddled with the responsibility of leasing or selling bandwidth, internet services, infrastructure such as cable lines to small internet service providers.

5 0
3 years ago
Which of the following is a variable expense for many adults?
IRINA_888 [86]
<span>C. Their monthly rent payment.</span>
7 0
3 years ago
Read 2 more answers
Mirrors on cars exist to
Ghella [55]

Answer:

Mirrors exist on cars so objects behind or to the side of the vehicle are brought into the driver's view. (such as cars, bicyclists, etc.) These spots are normally referred to as "blind spots", which are locations outside of the driver's peripheral vision that are difficult to see.

8 0
2 years ago
Which of the following is the largest measurement for the weight of a bag of dog food?
jasenka [17]

Answer:

approximately 5 lbs but no sure weight.

6 0
3 years ago
Read 2 more answers
Ishmael would like to capture a selected potion of his screen and then capture action he performs on that selected portion. What
Natalija [7]

Answer: User the insert screen recording control

Explanation:

Since Ishmael wants to capture a selected potion of his screen l, after which he'll then capture the action that he performs on that selected portion, he should use the insert screen recording control.

It should be noted that on most keyboards, there's an "insert screen" button. Also, Ishmael can simply open the window that he wants to screenshot and then click the screenshot button.

Therefore, the correct option is B.

6 0
2 years ago
Other questions:
  • A _______ is used to analyze and summarize your data without graphical support. A. PivotChart B. PivotTable C. chart D. table
    8·1 answer
  • must understand both art and engineering. a. industrial designer b. environmental designer c. interior designer d. graphic desig
    14·1 answer
  • What is a way to Procter your social security number and other sensitive information from identity theft
    9·1 answer
  • Help me with this, please. Are vacuum cleaners, Cd players, and telephones considered computers? Do they store any data or proce
    8·2 answers
  • 2.
    8·1 answer
  • One of the factors that influence the effectiveness of chemical sanitizer works effectively between 13° C and 49° C​
    10·1 answer
  • A data table is a range that displays what?
    15·2 answers
  • Type the correct answer in the box. Spell all words correctly.
    11·1 answer
  • What is the correct keyboard shortcut to cut a cell value
    15·1 answer
  • The class ________ is the portion of a class that is visible to the application's programmer.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!