Write a Java program which asks user to enter a character. If the character entered is a vowel, then it should print tha
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Write a Java program which asks user to enter a character. If the character entered is a vowel, then it should print tha
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: Please enter a character: A (taken from user) (taken from user) 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.
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