Question: same class (20 points) Problem 2-Write a program. Submit NumberLength,java Write a program that: -Asks a user to enter a number between 4-6 (including 4
same class (20 points) Problem 2-Write a program. Submit NumberLength,java Write a program that: -Asks a user to enter a number between 4-6 (including 4 and 6). This input should be stored in a variable called num. If they enter a number out of range (not 4, 5 or 6), the program should say "Number out of range " and exit. -Ask a user to enter a word with at least num (what the user entered before) letters and at most 10 letters . If they enter a word longer than this, the program should say "Too many lettersl" and end. If they enter a word shorter than num letters, the program should say "Too few letters!" and end. -Ask the user to enter another number between 1-3 (including 1 and 3) and store it in a variable called num2. You should print out that many letters of the word from the beginning. Example Program Run Please enter a number between 4-6:5 Enter a word with at least 5 letters and at most 10 letters: seashell Please enter another number between 1-3:3 sea POF
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
