Question: Given string userInput, output Fifth letter matches if the fifth character of userInput is 'w'. Otherwise, output Fifth letter does not. match. End with a

 Given string userInput, output "Fifth letter matches" if the fifth character

Given string userInput, output "Fifth letter matches" if the fifth character of userInput is 'w'. Otherwise, output "Fifth letter does not. match". End with a newline. Ex: If the input is: threw then the output is: Fifth letter matches Note: Assume the length of string userInput is greater than or equal to 5. \begin{tabular}{l|l} 1 & import java.util.Scanner; \\ 2 & pus \\ 3 & public class CharMatch \{ \\ 4 & public static void main(String[] args) \{ \\ 5 & Scanner scnr = new Scanner(System.in); \\ 6 & String userInput; \\ 7 & \\ 8 & userInput = scnr.nextLine(); \\ 9 & \\ 10 & \\ 11 & \\ 12 & \} \\ 13 & \end{tabular}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!