Write a Java program which asks user to enter a character. If the character entered is...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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) 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)
Expert Answer:
Answer rating: 100% (QA)
Java import javautilScanner public class VowelConsonantSwitch public static void mainString args Sca... View the full answer
Posted Date:
Students also viewed these programming questions
-
Assume that you have an algorithm that can fill 3D triangles with a constant colour. Explain what additional information and additions to the algorithm are required to Gouraud shade the triangles....
-
QUIZ... Let D be a poset and let f : D D be a monotone function. (i) Give the definition of the least pre-fixed point, fix (f), of f. Show that fix (f) is a fixed point of f. [5 marks] (ii) Show that...
-
Each of the following passages may be plausibly criticized by some who conclude that it contains a fallacy, but each may be defended by some who deny that the argument is fallacious. Discuss the...
-
A Pew Research poll in April 2009 from a random sample of U.S. adults asked the questions "Did you use the Internet yesterday?" and "Are you White, Black, or Hispanic / Other?" Is the response to the...
-
What is the role of trust in business? How does trust relate to stakeholder interests? How does trust engender ethical leadership? Evaluate Mark Hurd's actions in this case from an ethical and...
-
Auditors are often concerned that liabilities may be understated as a result of unrecorded payables. On the other hand, auditors may be concerned that liabilities are overstated as a result of...
-
Lamonda Corp. uses a job order cost system. On April 1, the accounts had the following balances: The following transactions occurred during April: (a) Purchased materials on account at a cost of...
-
Q37: Alberta Employee is paid $1500 bi-weekly, has a non-cash taxable benefit of $30, Pays union dues $40.00, contributes 3% of salary to RRSP, has Taxable allowance of $200 this pay. Calculate:...
-
Based on the text reading about visual aids in this Week, which visuals would work best for your speech and why? What information did you consider when making this decision and selecting the best...
-
Business Value Statement Based on your team review of the client stakeholder environment develop a set of business value propositions. This proposition must indicate what the client offers of value...
-
Do you think Land Value Tax would work in the US and elsewhere? Are there any flaws and/or challenges you would expect in the implementation of Land Value Tax?
-
An external force F, with a magnitude of 17.37 N, acts on a block of mass 1.60 kg parallel to a plane with an angle of 0-49.6 deg as shown. The body is observed to move at a constant velocity of 3.35...
-
Government claims to unpaid taxes Salary during last month owed to Mr. Key (not an officer) Administrative expenses Salary during last month owed to Ms. Rankin (not an officer) Unsecured accounts...
-
Write a 2-page report to show the impact on the GDP, unemployment and inflation in Canada right after the pandemic hit in March 2020. First, analyze the situation using the AS-AD model. Then research...
-
Read the "Software Laws, Hypotheses and Conjectures" on Static and dynamic testing and find at least two (2) of these laws, which are challenged or contradicted by the Agile Development Methodology.
-
Suppose you won a financial literacy competition and are given FJS10000 to invest, with the condition that investment can be done either in, i) Invest in Unit trust of Fiji or Invest in Fijian...
-
Find the response of the system described in Example 2.1 using Eq. (2.23). Data From Example 2.1:- Equation 2.23:- An undamped single-degree-of-freedom system has a mass of 1 kg and a stiffness of...
-
Describe how the phase angle \(\phi_{0}\) in Eq. (2.23) is to be computed for different combinations of positive and negative values of the initial displacement \(\left(x_{0} ight)\) and the initial...
-
Find the response of the system described in Problem 2.59 using Eq. (2.23). Data From Problem 2.59:- An undamped single-degree-of-freedom system consists of a mass \(5 \mathrm{~kg}\) and a spring of...
Study smarter with the SolutionInn App