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]
3 years ago
15

In JAVA, answer the following:

Computers and Technology
1 answer:
erica [24]3 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
How do I answer a question on Brainly.com without an “oops” notification?
Paul [167]
You just type in the answer as long as it is more then 20 characters
3 0
3 years ago
Read 2 more answers
Who is the primary audience for demonstrations of game prototypes made by the developer?
padilas [110]

Answer:

the tester

Explanation:

When a video game is playable the first audience to test these prototypes are the tester, these people have to test all the game, and they have say all the information about errors, issues, bugs, and any difficulty to resolve these problems in a final video game's version, in this way the complete game arrives to the final audience.

5 0
3 years ago
In what document does the program manager (pm) address the demilitarization and disposal requirements?
Nana76 [90]

Life Cycle Sustainment Plan (LCSP) is the document that the program manager (pm) addresses the demilitarization and disposal requirements.

<h3>What is Life Cycle Sustainment Plan?</h3>

Life Cycle Sustainment Plan is a plan or service that works during the trade of weapons or system work regarding militarization. This system works on the development and handling of the weapon system.

So, Life Cycle Sustainment Plan will be used in the demilitarization and management requirements.

Thus, the name of the document program is Life Cycle Sustainment Plan.

To learn more about Life Cycle Sustainment Plan, refer to the below link:

brainly.com/question/1272845?referrer=searchResults

#SPJ1

3 0
1 year ago
Word processing software, spreadsheet software, database software, and presentation software are examples of what category of co
wariber [46]
The correct answer is letter B. Application Software. Word Processing software, spreadsheet software, database software, and presentation software are examples of Application software. These are applications that are mostly output based.
8 0
3 years ago
15
valina [46]

Answer:

B.

shutter priority mode

Explanation:

Shutter Priority, which is mentioned as S on the mode dial, and the mode is  the time value, and is demoted as Tv, that points out to the setting in different forms of cameras that allows all to select a particular shutter speed, and as meanwhile the camera balances the aperture to ensure correct exposure in the image.

7 0
3 years ago
Read 2 more answers
Other questions:
  • Which of the following represents inbound logistics for a bookstore
    13·1 answer
  • An OS X backup utility that automatically backs up files to a dedicated drive that is always available when the computer is turn
    6·1 answer
  • How to select the entire table in microsoft excel
    11·1 answer
  • What should you do prior to writing your business document?
    11·1 answer
  • Which of the following must be configured in certain applications to help ensure data aggregation and data isolation are impleme
    15·1 answer
  • Write an algorithm to show whether a given number is even or odd.
    14·1 answer
  • Pick one of the following scenarios and
    6·1 answer
  • How do you get off of the comments after you look at them wit out going all the way off the app?
    15·1 answer
  • Design an Application called Student Course Management create interface called Student Course add an abstract method called ad C
    10·1 answer
  • 1) Coding for Table in Html<br>​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!