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]
4 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]4 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
Why is it important to use standard english when applying for a job
algol13
To start of on the right foot with your boss by showing him/her that you can be professional, but not be intimidating. Hope this helped.
8 0
4 years ago
Read 2 more answers
Explain two ways that you can create a header.
sveticcg [70]

Answer:

   

Explanation:

7 0
3 years ago
User 2.0 is most likely to Multiple Choice passively read and search for content. depend on content creators and avoid expressin
Ahat [919]

User 2.0 is most likely to: use the Internet for social connection.

<h3>What is User 2.0?</h3>

User 2.0 which is an aspect of Web 2.0 defines the latest form of the internet that allows users to interact with each other. This form of the internet is easy to use and requires participation by users.

So, a possible feature of User 2.0 will be the ability to use the internet for socialization.

Learn more about User 2.0 here:

brainly.com/question/3913924

5 0
3 years ago
What's a False statement about online time? A. Blue light from devices can make it hard to sleep. B. It's a good way to connect
mylen [45]

Answer:C

Explanation: This has no basis while the others have studied behind them.

4 0
4 years ago
You are given two variables, already declared and assigned values, one of type double, named price, containing the price of an o
Oksi-84 [34.3K]

Answer:

// here is code in C++.

#include <bits/stdc++.h>

using namespace std;

// main function

int main() {

//variable to store input

double price;

int totalNumber;

// variable to store total price

double total_price;

cout<<"Enter the price of an order:";

// read the price of an order

cin>>price;

cout<<"Enter the number of orders:";

// read the total number of orders

cin>>totalNumber;

// calculate total price of all orders

total_price=price*totalNumber;

cout<<"total price of all orders: "<<total_price<<endl;

return 0;

}

Explanation:

Declare three variables "price" of double type,"totalNumber" of int type And "total_price" of type double.Read the value of an order and number of orders. The calculate the total price by multiply "price" with "totalNumber" and assign it to variable "total_price". Print the total price.

Output:

Enter the price of an order:12.5                                                                                                                              

Enter the number of orders:3                                                                                                                                  

total price of all orders: 37.5

7 0
4 years ago
Other questions:
  • PLEASE HELP!!!!!!!!!!!
    15·2 answers
  • What are some pros for having your phone during school hours?
    10·2 answers
  • 1.printer is an example of......... device.<br><br>​
    11·2 answers
  • If the system has a mechanical advantage of 5 and the load of 350N.What effort is needed to lift the weight? Provide your answer
    10·1 answer
  • 3<br> Select the correct answer.<br> What is the output of the following HTML code?<br>Please
    8·2 answers
  • No links it’s just a normal question about iPhones.
    13·1 answer
  • How do i delete peoples comments
    14·2 answers
  • A __________ is a sequence of characters.
    10·1 answer
  • Who is the monst important person and why
    11·1 answer
  • PLEASE ANSWER AND HURRY I'LL MARK YOU BRAINLIEST!!<br><br><br>​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!