Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a program that prompts the user to provide a single character from the alphabet. Print Vowel or Consonant, depending on the user input. If
Write a program that prompts the user to provide a single character from the alphabet. Print "Vowel" or "Consonant", depending on the user input. If the user input is not a letter between a and z or A and Z or is a string of length print the error message "Input is not a single character".
Vowels are the letters a e o u i Any other letter is a consonant.
The following are sample runs of demonstrate the program:
Sample run :
Please enter a single character:
a
Vowel
Sample run :
Please enter a single character:
x
Consonant
Sample run :
Please enter a single character:
hello
Input is not a single character
Note: Your program should be able to handle upperlower case characters.
solve with java
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