Question: Write a Java program that prompts the user to enter an integer between 1 and 2 6 ( inclusive ) . If the number entered

Write a Java program that prompts the user to enter an integer between 1 and 26(inclusive). If the number
entered is outside this range, the program should print "The entered number is not between 1 and 26." If the
number is within the range, the program should print the first n letters of the alphabet in uppercase, where n is
the number entered by the user.
Here are a few sample runs:
Enter an integer number between 1 and 26: 35
The entered number is not between 1 and 26.
Enter an integer number between 1 and 26: 2
AB
Enter an integer number between 1 and 26: 15
ABCDEFGHIJKLMNO
Hint: The following code will print D.
char letter =(char)('A'+3);
System.out.print(letter);

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!