Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

would like help with this. Please include explanation and properly space the code. (beginner code only). I had an expert help with this code but

would like help with this. Please include explanation and properly space the code. (beginner code only). I had an expert help with this code but It had indenting errors and was not basic. thank you for your help

image

EnterANumberBetwee5And10 Write a public class call EnterANumberBetwee5 And10 with a main method. what it does: 1. prompt user for a number (see examples) 2. read from user 3. if the user didn't enter a number go to step 1 4. if the user didn't entered a number between 5 and 10 (inclusive) go to step 1 5. otherwise print: "you entered a valid number" followed by the number (see examples) Restrictions: do not use anything we haven't covered in class. HINT: we wrote a similar programs in slides 29 and 30 of ch06. Never use System.err.print. Always use System.out.print or println because this is a loop that expects certain inputs if your program doesn't read the inputs described here you may get a "your program took too long" error. That means the logic of your program is wrong. Examples % java EnterANumberBetween5And10 enter a number between 5 and 10 (inclusive): a a is not a number enter a number between 5 and 10 (inclusive): hello hello is not a number enter a number between 5 and 10 (inclusive): 4 you entered a bad number enter a number between 5 and 10 (inclusive): 5.6 you entered a valid number: 5.6 % java EnterANumberBetween5And10 enter a number between 5 and 10 (inclusive): 9 you entered a valid number: 9.0 % java EnterANumberBetween5And10 enter a number between 5 and 10 (inclusive): 20 you entered a bad number enter a number between 5 and 10 (inclusive): 7 you entered a valid number: 7.0 %

Step by Step Solution

3.47 Rating (150 Votes )

There are 3 Steps involved in it

Step: 1

a Java program that prompts the user to enter a number between 5 and 10 and ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students also viewed these Programming questions