Exercise 5 Exercise5.java l public class Exercise5 { 2- public static void main(String args[]) { Collapse Conditionals -

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

Exercise 5 Exercise5.java l public class Exercise5 { 2- public static void main(String args[]) { Collapse Conditionals -

Post by answerhappygod »

Exercise 5 Exercise5 Java L Public Class Exercise5 2 Public Static Void Main String Args Collapse Conditionals 1
Exercise 5 Exercise5 Java L Public Class Exercise5 2 Public Static Void Main String Args Collapse Conditionals 1 (74.25 KiB) Viewed 66 times
Exercise 5 Exercise5.java l public class Exercise5 { 2- public static void main(String args[]) { Collapse Conditionals -> Coding Exercise - Conditionals 3 4 String x = args[0]; //add code below this line 5 Exercise 5 6 7 8 //add code above this line Conditionals Exercise 5 9 10 11 } } Problem Use the variable x as you write this program. x will represent a string. Write a program that determines if x is a vowel (a, e, i, o, and u). If yes, print is a vowel , where the blank is the value of x. If no, print _ is not a vowel, where the blank is the value of x. Expected Output • If x is a , then the output would be: a is a vowel • If x is z , then the output would be: z is not a vowel. Comparing Strings If you choose to directly compare Strings, you may be tempted to write x == "a". However, this won't behave as expected. Instead, use .equals() . For example, x.equals("a")
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply