Question: Write a program that prompts the user to enter two strings, and reports whether the second string is a substring of the first string. Enter

Write a program that prompts the user to enter two strings, and reports whether the second string is a substring of the first string.
Enter string s1: ABCD
Enter string s2: BC
BC is a substring of ABCD

Enter string s1: ABCD
Enter string s2: BDC
BDC is not a substring of ABCD

Step by Step Solution

3.34 Rating (172 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

import javautilScanner public class Exercise0422 public static void mainStr... 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 Introduction to Java Programming and Data Structure Questions!