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
Modern processors today utilize _____ when fetching instructions as a means of predicting where the branch will go and even begi
ss7ja [257]

Answer:Speculative prediction

Explanation: Speculative prediction is the prediction method which can be optimizing in nature.This method usually runs in such a way that can lead ahead of time by predicting the next step or it's result.

This technique is also known as the dynamic execution which is usually found in the CPU devices and some other modern processing devices.Speculation prediction and execution works even when there is no necessity of the knowing about the next instruction.The result appearing can be correct or incorrect.

3 0
3 years ago
Why are response tests more difficult for some students? What can you do to make them easier for yourself?
Kobotan [32]

Answer:

Because some students think that teachers give you hard things so you could pass to go to a grade, if you study you might pass

3 0
4 years ago
Read 2 more answers
The sign used for closing a tag is​
iragen [17]

Answer:

The sign used for closing a tag is answer is /.

Explanation:

I program all the time and when I am programming in HTML I use tags all the time so I basically memorized it.

8 0
3 years ago
Which range function creates the following list of numbers?<br> 76 74 72 70 68 66 64 62
baherus [9]

Answer:

they look like even number

Explanation:

2 4 6 8 10 12 -------seeeeee but not hundred percent sure but plz put me in brainlist

4 0
3 years ago
How do you ask brainy a question without it not liking the question and saying it hurts their feelings?
murzikaleks [220]
IM SORRY but i dont now your question

7 0
4 years ago
Other questions:
  • PLEASE HELP PROGRAMMING WILL GIVE BRAINLIEST
    6·1 answer
  • Which feature of a browser will you select to block pop-ups? view help tools file
    15·2 answers
  • True or False. A modern programming EXE provides a text editor, a file manager, a compiler, a linker and loader, and tools for d
    9·1 answer
  • Which of the following gadgets is best for making a soft-shell shape out of butter?
    15·2 answers
  • Fill in the blank: _________ is Google’s machine-learning artificial intelligence system that interprets people’s searches to fi
    9·1 answer
  • Importance of Microsoft access​
    5·1 answer
  • What is the first step in finding a solution to a problem
    13·1 answer
  • NEED HELP ASAP
    13·2 answers
  • A line graph is a great tool for showing changes over time. Why is a line graph better than other graphs at showing this type of
    6·1 answer
  • As we’ve discussed, computer programs are considered creative works and are protected by copyright. That means those programs be
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!