Write a program that prompts the user to enter two strings and reports whether the second string is a substring of the first string. input ABCD BC output $2 is a substring of s1 input ABCD BDC output s2 is not a substring of s1

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter5: Looping
Section: Chapter Questions
Problem 13E
icon
Related questions
Question

please do not change the outline of the code!

 

Write a program that prompts the user to enter two strings and reports whether the second string is a substring of the first string.
input
ABCD
BC
output
$2 is a substring of s1
input
ABCD
BDC
output
s2 is not a substring of s1
+ Grading Criteria
Transcribed Image Text:Write a program that prompts the user to enter two strings and reports whether the second string is a substring of the first string. input ABCD BC output $2 is a substring of s1 input ABCD BDC output s2 is not a substring of s1 + Grading Criteria
1 import java.util.*;
2
3 //Your program will be evaluated by this DriverMain class and several test cases.
4
I
5. public class DriverMain {
6 ▾
7
8
9
10
11
12 }
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
//write your code heres
}
Transcribed Image Text:1 import java.util.*; 2 3 //Your program will be evaluated by this DriverMain class and several test cases. 4 I 5. public class DriverMain { 6 ▾ 7 8 9 10 11 12 } public static void main(String[] args) { Scanner input = new Scanner(System.in); //write your code heres }
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Problems on Dynamic Programming
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,