Question: Write a complete java program that asks the user for a digit between 0 and 9 . Using a switch statement, print out a reply

Write a complete java program that asks the user for a digit between 0 and 9. Using a switch statement, print out a reply with the number as a word, "You entered _number_."; If anything other than a digit 0-9 is entered, print an error message. Note that you do need to include code comments, you do not need to include formal documentation.
For example,
Please enter a digit: 7
You entered seven.
Please enter a digit: Q
You entered 'Q', which is not a digit between 0 and 9.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!