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
abruzzese [7]
2 years ago
15

In JAVA, answer the following:

Computers and Technology
1 answer:
erica [24]2 years ago
7 0

Answer:

The JAVA program is as follows.

import java.util.Scanner;

public class Program

{

   static int n;

public static void main(String[] args) {

    //scanner object

    Scanner stdin = new Scanner(System.in);

    //loop executes till number entered is in the range of 1 to 10

    do

    {

        System.out.print("Enter any number: ");

        n = stdin.nextInt();

    }while(n<1 || n>10);

    System.out.println("Number is valid. Exiting...");

}

}

OUTPUT

Enter any number: 0

Enter any number: 23

Enter any number: 10

Number is valid. Exiting...

Explanation:

The program is explained.

1. The integer variable, n, is declared static since the variable should be accessible inside main() which is static.

2. An object of Scanner, stdin, is created inside main().

3. Inside do-while loop, the user is asked input any value for n.

4. The loop continues till user inputs a number which is not in the given range, beginning from 1 to 10.

5. The loop will not be terminated till the user enters a valid input.

6. Once a valid input is entered, the message is displayed to the console and the program ends.

7. The variable, n, is declared at the class level and is a class variable. Class variables are declared inside the class but outside all the methods in that class.

8. Since JAVA is a purely object-oriented language, all the code is written inside class.

9. The object of class is not created since only one class is included in the program. If more than one class is included, then the object of the class which does not has the main() method will be created inside main().

10. User input for integer is taken via scanner object and using nextInt() method.

11. The methods, print() and println() display the messages to the console. The only difference is that println() inserts a new line after displaying the message.

12. The name of the class having main() and the name of the program should be the same.

You might be interested in
7. When using find command in word we can search?
lesya [120]

Answer:

When using find command in word we can search all of the above

6 0
3 years ago
which responses would you use for a computer or electronic medical record outage? (select all that apply)
kupik [55]

The responses that a person need to use for a computer or electronic medical record outage is option A: Verify computers, printers, and WOWs are plugged into red outlets.

<h3>What are the problems with electronic medical records?</h3>

In regards to  computer or electronic medical record, there are sometimes where there is found to be some outage.

Note that  based on  USF Health, some key healthcare givers and patients can be very concerned in regards to  medical privacies if they are using EHRs.

Note that some of the concerns includes the lost information as a result of a natural disaster as well as cyber hacks.

Hence, The responses that a person need to use for a computer or electronic medical record outage is option A: Verify computers, printers, and WOWs are plugged into red outlets.

Learn more about medical record from

brainly.com/question/21819443

#SPJ1

See full question below

5. Which responses would you use for a computer or electronic medical record outage? (select all that apply)

Verify computers, printers, and WOWs are plugged into red outlets.

Reset equipment, if needed, by turning on and off.

Locate downtime forms and use if directed.

Verify critical patient care equipment is functioning properly.

Refer to downtime computer and printer on unit.

Use red emergency phones.

8 0
1 year ago
What is the maximum number of colors that should be used on a slide?
gavmur [86]
The most commonly accepted amount of colors on one slide is 4
7 0
3 years ago
Read 2 more answers
What are the features of a computer speaker​
Aliun [14]
Some computer speakers have equalization features such as bass and treble controls. Bluetooth speakers can be connected with a computer by using an Aux jack and compatible adaptor. More sophisticated computer speakers can have a subwoofer unit, to enhance bass output.
Hope that helps....it on googIe
6 0
3 years ago
Give an example of an occasion when you used logic to solve a problem
netineya [11]
You can use it when like confirming a policy
8 0
3 years ago
Other questions:
  • How do u change the level of education on Brainly. cuz i just finished elementry
    9·2 answers
  • Kurt is editing a table in his powerpoint that displays accounting formulas and when to use them. he wants to remove the table s
    15·1 answer
  • A. True <br> b. False: variables represent storage locations in the computer's memory.
    13·1 answer
  • A method's name and parameter list constitute the method's ____.
    13·1 answer
  • In the table below identify the data type that would be most suitable for the second field
    14·1 answer
  • What makes iron man different from other superheroes ? why is iron man the best superhero ??
    5·2 answers
  • The first version of the SMTP protocol was defined in RFC 821. The current standard for SMTP is defined in RFC 5321 considering
    11·1 answer
  • A business traveler notices there is an extra connector between the keyboard and the computer, in a business center. She has mos
    12·1 answer
  • Toby has lost valuable data on his computer a number of times due to system crashes caused by viruses. He decides to invest in a
    13·1 answer
  • Dragging a mouse over text is called
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!