Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started