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
According to your​ reading, Macy's uses​ ________ technology to track individual items for sale on store shelves.
Setler79 [48]
She uses the Radio-frequency identification(RFID) which is a technology that uses electromagnetic fields to automatically identify and track tags attached to objects.These tags contain electronically-stored information.the passive tags collect energy from a nearby RFID readers interrogating radio waves.They contain an integrated circuit and an antenna which are used to transmit data to the RFID reader also called an interrogator.
8 0
3 years ago
Read 2 more answers
Mark is learning to make logos. Once he finishes learning, he plans to freelance. Which software is most preferred to create art
MAVERICK [17]
Abode Illustrator helps to design logos in professional way
8 0
3 years ago
What job does a front-end developer perform?
alina1380 [7]

Answer:

They manage making websit/es beautiful. Basically how brainly is setup? The layout is nice? Front end developers are responsible for why webpages look pretty or nicely done. <em>fun fact, my dream job is a front end developer!</em>

5 0
2 years ago
In the broadest of terms, the performance management process features a cycle that begins with ________________ and concludes wi
Flauer [41]

In the broadest of terms, the performance management process features a cycle that starts with Prerequisites and concludes with performance Review.

<h3>What is performance management process?</h3>

Performance management exists as a communication procedure by which managers and employees work together to plan, monitor, and review an employee's work goals and overall contribution to the organization. Effective performance management exists important to businesses. Through both formal and informal processes, it allows them to align their employees, resources, and systems to complete their strategic objectives.

<h3> Steps of the performance process</h3>
  • Step 1: Create a Performance Management Plan. Create the plan as described as possible, avoiding the usage of ambiguous language.
  • Step 2: Set Goals for Performance Management.
  • Step 3: Complete a Performance Review System.
  • Step 4: Create Strong Feedback-Giving Skills.
  • Step 5: Ongoing Employee Performance Management.

Hence, In the broadest of terms, the performance management process features a cycle that starts with Prerequisites and concludes with performance Review.

To learn more about performance management process refer to:

brainly.com/question/14506325

#SPJ4

3 0
1 year ago
Assume the following variable definition appears in a program:
AnnZ [28]

Answer:

cout << setprecision(2)<< fixed << number;

Explanation:

The above statement returns 12.35 as output

Though, the statement can be split to multiple statements; but the question requires the use of a cout statement.

The statement starts by setting precision to 2 using setprecision(2)

This is immediately followed by the fixed manipulator;

The essence of the fixed manipulator is to ensure that the number returns 2 digits after the decimal point;

Using only setprecision(2) in the cout statement will on return the 2 digits (12) before the decimal point.

The fixed manipulator is then followed by the variable to be printed.

See code snippet below

<em>#include <iostream>  </em>

<em>#include <iomanip> </em>

<em>using namespace std;  </em>

<em>int main()  </em>

<em>{  </em>

<em> // Initializing the double value</em>

<em> double number = 12.3456;  </em>

<em> //Print  result</em>

<em> cout << setprecision(2)<< fixed << number;  </em>

<em> return 0;  </em>

<em>}  </em>

<em />

4 0
3 years ago
Other questions:
  • You are using Windows 10 and you have created a file with called “my text” in notepad with a .txt extension type. You need to ch
    13·1 answer
  • How to check what level you are in runescape?
    9·2 answers
  • In which of the following scenarios would it be best to use a for loop?
    6·1 answer
  • Select the correct answer.
    13·1 answer
  • What command displays a computer s network settings?
    5·1 answer
  • Seeing an error message on the screen after you click on a link or icon may indicate that your PC doesn't have the correct _____
    15·1 answer
  • Fill in the word to complete the sentence.
    10·1 answer
  • Why does this website have so many copies of plagiarism?
    5·1 answer
  • The _____ of a story describes the time and location of a story.
    5·2 answers
  • What does this mean? And how did I get it?
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!