Question: 5 3 8 0 6 8 . 4 0 2 8 2 7 2 . qx 3 zqy 7 Given string userInput on one line

538068.4028272.qx3zqy7
Given string userInput on one line and character charToFind on a second line, output "Matching" if the fourth character of
userInput matches charToFind. Otherwise, output "Not matching". End with a newline.
Ex: If the input is:
threw
e
then the output is:
Matching
Note: Assume the length of string userlnput is greater than or equal to 4.
import java.util.Scanner;
public class MatchingChar {
public static void main(String[] args){
Scanner scnr = new Scanner(
System.in);
String userInput;
char charToFind;
userInput = scnr.nextLine(
 538068.4028272.qx3zqy7 Given string userInput on one line and character charToFind on

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To complete the Java code we need to access the fourth character of userInput and compare ... View full answer

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!