Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Java Write a do-while loop that continues to prompt a user to enter a number less than 100, until the entered number is actually less
Java
Write a do-while loop that continues to prompt a user to enter a number less than 100, until the entered number is actually less than 100. End each prompt with newline Ex: For the user input 123, 395, 25, the expected output is:
Enter a number (<100): Enter a number (<100): Enter a number (<100): Your number < 100 is: 25
import java.util.Scanner;
public class NumberPrompt { public static void main (String [] args) { Scanner scnr = new Scanner(System.in); int userInput;
//Your Code here
System.out.println("Your number < 100 is: " + userInput); } }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started