Question: Task 1 (20pts) - Multiple choice, string comparison (case insensitive), Java file: HW3_Faces.java Write a program that allows the user to print one of 4


Task 1 (20pts) - Multiple choice, string comparison (case insensitive), Java file: HW3_Faces.java Write a program that allows the user to print one of 4 possible faces. The options for faces are: bo - Bold, Open eyes bc - Bold, Closed eyes ho - Hat, Open eyes hc - Hat, Closed eyes The program should be case insensitive, meaning that it will work well with both upper case and lower case letters or a combination of those. E.g.all these are valid choices: bo, BO, O, Bo. Hints: You may want to use the s.toLowerCase() or s.toUpperCase() where s is a string. Keep in mind that they do not modify s, but they return a new string. Do NOT use == to compare strings. Develop your program gradually. ------- Sample run 1 Enter face choice (bo/bc/ho/hc): ho - 1 Bye ------- Sample run 2 (Note: case insensitive: works for Uppercase letters as well) Enter face choice (bo/bc/ho/h): Ho TO O Bye ------- Sample run 3 Enter face choice (bo/bc/ho/hc): bo O 01 Bye ------- Sample run 4 Enter face choice (bo/bc/ho/hc): BC - - Bye ------- Sample run 5 Enter face choice (bo/bc/ho/hc): hc | - - | - - - - - Bye
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
