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
Discuss the types of data that business might collect and how the business could use that data to drive decision-making in a spe
Rudik [331]

Answer:

Answered below

Explanation:

A business such as an online store like Amazon can collect user data like name, address, mouse clicks on products, how long users stay on page viewing a particular product, marital status, education and many more.

These data are used by these businesses to drive decision-making that enhances the sale of their goods. For instance, adverts and search alternatives about a particular good can be shown to people who have looked at them before. A newly married or pregnant woman would be shown baby products etc.

3 0
3 years ago
What is the major benefit Smartphones and tablet computers have had on social media?
Naddika [18.5K]

Answer:

c

Explanation:

The biggest advantage of smartphones and tablets is that they increased the mobility. This allowed users to access the social media platforms whenever they want. The users can login to their accounts even they are travelling by bus or walking around. This was not possible back in the days where people mostly use desktop computers.

8 0
2 years ago
Which automatic startup option should you choose when windows' startup fails immediately after installing a new driver but befor
Luda [366]

Answer:

last known good configuration

Explanation:

If you're having difficulties starting Windows, the Last Known Good Configuration, or LKGC for short, is a technique to get it started. It loads the drivers and registry data from the last time you began and shut down your computer successfully.

3 0
2 years ago
How to make the heart symbol in photoshop
sveta [45]
Click the font drop-down box in the tool settings bar. Select "Arial." 6. Press "Alt-3" using your keyboard number pad's "3" key to insert the heart symbol<span>.</span>
3 0
3 years ago
Read 2 more answers
You must keep track of some data. Your options are: (1) A linked-list maintained in sorted order. (2) A linked-list of unsorted
ladessa [460]

Answer:

Question was incomplete and continued the question

For each of the following scenarios, which of these choices would be best? Explain your answer.

BST

Sorted Array

Un-sorted Array

a) The records are guaranteed to arrive already sorted from lowest to highest (i.e., whenever a record is inserted, its key value will always be greater than that of the last record inserted). A total of 1000 inserts will be interspersed with 1000 searches.

b) The records arrive with values having a uniform random distribution (so the BST is likely to be well balanced). 1,000,000 insertions are performed, followed by 10 searches.

Explanation:

Answer for a: Un-sorted array or Un-sorted linked list : as mentioned in the question itself that the records are arriving in the sorted order and search will not be O(log n) and insert will be not be O(n).

Answer for b : Un-sorted array or Un-sorted linkedlist : Number of the items to be inserted is already known which is 1,000,000 but it is very high and at the same time search is low. Unsorted array or Unsorted linked list will be best option here.

7 0
3 years ago
Other questions:
  • What was the first browser that allowed for graphics to be viewed on the web?
    14·2 answers
  • You can leave out the ____ statements in a switch structure.
    15·1 answer
  • Write a program C statement to declare and initialize an array named afTest1 type float to store
    11·1 answer
  • In cell G6, use the appropriate lookup and reference function to retrieve the rental rate from the named range RentalRates. The
    15·1 answer
  • What is a Software that interprets commands drom the keyboard and mouse
    13·1 answer
  • SOLVE IN C:
    10·1 answer
  • Witch factor will increase a populations size
    6·2 answers
  • How many passes will it take to find the four in this list? 4, 5, 6, 7, 8, 9, 10 1 2 3 4
    12·2 answers
  • The complete process for learning through repetition is to read, write, say, rest and revisit the information. Please select the
    12·2 answers
  • The Open Systems Interconnection (OSI) Reference Model: defines standards for many aspects of computing and communications withi
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!