Question: Write a Java program which asks user to enter a character. If the character entered is a vowel, then it should print that it

Write a Java program which asks user to enter a character. If


Write a Java program which asks user to enter a character. If the character entered is a vowel, then it should print that it is vowel, otherwise it should print, it is a consonant. Use Switch statement to write your program. The switch statement should be used such that least number of break statements are present in switch. NOTE: Every student must enter his/her own name and student id at the start of program as shown in output. (Hint 1: A, E, I, O, U, a, e, i, o u are vowels.) (Hint 2: You can use letter = input.next().charAt(0); to get character from user) Output Please enter your name: Please enter your Student id: (taken from user) (taken from user) I Please enter a character: A This is a vowel. // A is used just for reference here. In your case, user must be able to enter // character at runtime. Specifications Get input from user in the form of character using Scanner class. (Marks 2) . Use Switch statement to print out if the character entered by user is vowel or consonant. (Marks 6)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Java import javautilScanner public class VowelConsonantSwitch public static void mainString args Sca... View full answer

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!