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]
3 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]3 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
Data that are collected on large populations of individuals and stored in databases are referred to as _____.
xz_007 [3.2K]
The answer is statistics
4 0
3 years ago
Which of the following is an example of data an Earth-observing satellite would collect?
Natalka [10]

Answer:

A

Explanation:

Hopefully this helps

4 0
2 years ago
Consider the following program segment. ifstream inFile; //Line 1 int x, y; //Line 2 ... //Line3 inFile &gt;&gt; x &gt;&gt; y; /
AnnyKZ [126]

Answer:

inFile.open("progdata.dat");

Explanation:

5 0
2 years ago
What is sexual intercourse <br><br>​
n200080 [17]

Answer:

immmm ....

I know the answer but I won't tell..lolllll

7 0
2 years ago
Read 2 more answers
How can I create a pluralsite account for free to sign in​
nevsk [136]

Answer:

I mean I need points but I'm not sure my advice is to look it up or look on y0utube : )

Explanation:

6 0
3 years ago
Other questions:
  • In three to five sentences, describe how you can organize written information logically and sequentially
    8·1 answer
  • Enterprise application integration (eai) software enables users to model the business processes and interactions that should occ
    8·1 answer
  • What are features of a product?
    8·2 answers
  • Dang was accepted to a biology program with a rigorous schedule and a high tuition, but good professors. What would be a benefit
    10·2 answers
  • What is the default font style of “Title” box in MS PowerPoint 2013?
    8·1 answer
  • The ____ attribute can be used only with input boxes that store text. Group of answer choices type pattern required value
    9·1 answer
  • Consider the relational schema below: Students(sid: integer, sname: string, major: string) Courses(cid: integer, cname: string,
    9·1 answer
  • Will this website ever get itself together to stop people from sending links?
    9·1 answer
  • 15 _____ 3 = 0 Question 11 options: a) / b) % c) * d) //
    12·1 answer
  • This method of file transfer has been used for decades and is frequently used for uploading changes to a website hosted by an in
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!