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
belka [17]
4 years ago
12

Write a program that produces the following output (where the user may enter any positive integer under 10):______

Computers and Technology
1 answer:
Mekhanik [1.2K]4 years ago
3 0

Answer:

// The Scanner class is imported to allow the program receive user input

import java.util.Scanner;

// The class is defined called Solution

public class Solution {

   // The main method is defined which begin program execution

   public static void main(String args[]) {

     // Scanner object 'scan' which receive user input from the keyboard

     Scanner scan = new Scanner(System.in);

     // the userInput variable is initially set to 1 (true) to allow the program continue prompting the user for input

     int userInput = 1;

     // while loop which continue execution as long as the userInput is greater than 0 and less than 10

     while (userInput > 0 && userInput < 10){

         // Prompts is displayed to the user to enter number below 10

         System.out.println("Enter a positive integer under 10:__________");

         // the next input is assigned to userInput

         userInput = scan.nextInt();

     }      

   }

}

Explanation:

The above code continue prompting the user to input an integer as long as the input is greater than 0 and less than 10.

You might be interested in
How do I use files and functions in programming?
maw [93]

answer:

1.The program comes to a line of code containing a "function call".

2.The program enters the function (starts at the first line in the function code).

3.All instructions inside of the function are executed from top to bottom.

4.The program leaves the function and goes back to where it started from.

5.Any data computed and RETURNED by the function is used in place of the function in the original line of code.

3 0
3 years ago
how do i turn off itallics on a school chromebook i accidentally turned them on in another tab and i dont know how to undo them
Rudiy27
U go in to the bar with i b u the is italics and u press it again and it will turn it off but u have to have the text selected
5 0
3 years ago
How can you skillfully use the internet for research
elena-s [515]

By looking up your research on websites that have (.org) or wikipedia for answers u might have to find information

6 0
4 years ago
Which internet technology allows businesses to make presentations and share visual aids such as charts and graphs ?
Akimi4 [234]

Web conferencing is an internet technology that allows people in remote locations collaborate in a virtual conference room by making presentations and sharing visual aids.

Let me know if you have any questions.

8 0
4 years ago
Read 2 more answers
A. The client is running in a loop:
Ierofanga [76]
Aaaaaaaaaaaaaaaaaaaaaaaaaaaa
4 0
3 years ago
Other questions:
  • Disk scheduling algorithms in operating systems consider only seek distances, because Select one: a. modern disks do not disclos
    13·1 answer
  • Easy STEAM question :)
    15·2 answers
  • A written guarantee to fix or replace an item is called a _____.
    5·2 answers
  • This stores a piece of data and gives it a specific name
    7·1 answer
  • Nvm, Its B.
    10·1 answer
  • Is it possible to make teleportation with a fusion device
    15·1 answer
  • . When a function template has two parameterized types, one as the return value, and one as an argument, then _____.
    11·1 answer
  • Why was it important for the date format to be standardized by the
    7·1 answer
  • Explain the term game! And give me complete sentences. U can use ur opinion as well!
    11·1 answer
  • In one to two sentences, describe how you would add a new slide to your presentation.
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!