Write a program that prompts the user to enter two strings and reports whether the second string
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.
Transcribed Image Text:
Enter string sl: ABCD Enter string s2: BC substring of ABCD - Enter JEnter BC is a Enter string sl: ABCD Enter string s2: BDC JEnter Enter BDC is not a substring of ABCD
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 75% (4 reviews)
Program Plan Create a class called CheckSubString Initialize the main method with variables Si s2 as ...View the full answer
Answered By
Carly Cimino
As a tutor, my focus is to help communicate and break down difficult concepts in a way that allows students greater accessibility and comprehension to their course material. I love helping others develop a sense of personal confidence and curiosity, and I'm looking forward to the chance to interact and work with you professionally and better your academic grades.
4.30+
12+ Reviews
21+ Question Solved
Related Book For
Introduction to Java Programming, Comprehensive Version
ISBN: 978-0133761313
10th Edition
Authors: Y. Daniel Liang
Question Posted:
Students also viewed these Computer science questions
-
Write a program that prompts the user to enter the center x-, y-coordinates, width, and height of two rectangles and determines whether the second rectangle is inside the first or overlaps with the...
-
Write a program that prompts the user to enter the length from the center of a pentagon to a vertex and computes the area of the pentagon, as shown in the following figure. The formula for computing...
-
Write a program that prompts the user to enter the center coordinates, width, and height of two rectangles from the command line.The program displays the rectangles and a text indicating whether the...
-
On 31 March 1980, Philip acquired a 48-year copyright at a cost of 85,000. The copyright was valued at 92,000 on 31 March 1982. On 31 March 2021, Philip sold the copyright for 47,000. Compute the...
-
Show that the worst-case complexity in terms of comparisons of an algorithm that finds the maximum and minimum of n elements is at least [3n/2] 2.
-
A quality control technician needs to determine the percentage of arsenic (As) in a particular pesticide. The pesticide is dissolved, and all of the arsenic present is converted to arsenate ions (AsO...
-
Use the financial data for Randa Merchandising, Inc., in Exercise 13-13 to prepare its income statement for calendar-year 2017. (Ignore the earnings per share section.) Data From Exercise 13.13 In...
-
On December 31, 2008, Menachem Inc. rendered services to Begin Corporation at an agreed price of $91,844.10, accepting $36,000 down and agreeing to accept the balance in four equal installments of...
-
Let X be a binomial random variable with the probability distribution f(x) shown below. Find the probability distribution of the random variable Y=x. f(x)= Bere 3-x x=0,1,2,3 elsewhere Complete the...
-
Consider the following 0x86 program: .data array DWORD 1,2,3,4,5,6,7,8,9 aravSize -(S-array)/4 ; array .code main PROC mov ecx,arraySize-1 mov esi.OFFSET array L1: mov eax. [esi] sda mov bx,2 idiv bx...
-
Write a program that reads the following information and prints a payroll statement: Employee?s name (e.g., Smith) Number of hours worked in a week (e.g., 10) Hourly pay rate (e.g., 9.75) Federal tax...
-
Write a program that prompts the user to enter a Social Security number in the format DDD-DD-DDDD, where D is a digit. Your program should check whether the input is valid. Here are sample runs:...
-
How would you explain to a friend why the optimal amount of freeway congestion is not zero?
-
Create a version of the LIFEBLOOD DOCTRINE. Do not merely define the same or copy and paste from other sources. The more creative, the better.
-
Operum is a firm that hires unskilled laborers in a perfectly competitive factor market. (a) Draw side-by-side graphs for the whole labor market and for Operum. Label the market supply SL, the market...
-
Examine the intricate mechanisms governing protein folding and misfolding, delving into the pivotal role of molecular chaperones in preserving proteostasis, and assess their implications in the...
-
This week will develop the Marketing Mix strategies you recommend that East Chestnut Regional Health System will implement. Individually , create marketing mix strategy by completing parts I-IV...
-
Larry is a bank officer and is married to Lisa, a law lecturer at a university, Lisa specializes in environmental law. In July 2020, Larry resigned from his job and started a new delicatessen...
-
The assets and liabilities of Web Services Inc. as of December 31, 2017 and revenues and expenses for the year ended on that date are listed here. Beginning retained earnings were $60,000, and...
-
What are multinational corporations (MNCs) and what economic roles do they play?
-
Programming Exercise 8.5 describes how to perform matrix addition. Suppose you have multiple processors, so you can speed up the matrix addition. Implement the following method in parallel: public...
-
Revise Listing 32.10, ParallelMergeSort.java, to define a generic parallelMergeSort method as follows: public static > void parallelMergeSort(E[] list) Data from Listing 32.10, 1mport...
-
Rewrite Listing 32.6, ThreadCooperation.java, using the objects wait() and notifyAll() methods. Data from Listing 32.6, 1mport java.util.concurrent.: 2 1mport java.util.concurrent. locks.: 1 3 4...
-
4. Elizabeth has $1537.21 in her savings account. The account pays 4% compounded monthly. Elizabeth does not make any deposits or withdrawals over the next 6 months. How much interest does the...
-
7. Part of an amortization table is shown below. Determine the missing values in the table labeled A, B, C, D Payment Monthly Interest Principal Outstanding A) number payment paid paid balance 0 $175...
-
3. Calculate the following dosages according to kilogram of body weight: a. The physician ordered Zovirax capsules 5 mg/kg every 8 hours for 7 days for a patient who has a diagnosis of herpes zoster....
Study smarter with the SolutionInn App