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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
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

Post by answerhappygod »

Write A Java Program Which Asks User To Enter A Character If The Character Entered Is A Vowel Then It Should Print Tha 1
Write A Java Program Which Asks User To Enter A Character If The Character Entered Is A Vowel Then It Should Print Tha 1 (63.23 KiB) Viewed 76 times
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: 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.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply