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: 66% (6 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.
-
How might you try and change this element of culture, in this organisation, with its diverse workforce? LO.1
-
Demonstrate some common methods of creative accounting. L01
-
1. Which projects would you recommend Handstar pursue based on the NPV approach? 2. Assume the founders weigh a projects NPV twice as much as both obtaining/retaining a leadership position and making...
-
The financial manager of a firm determines the following schedules of cost of debt and cost of equity for various combinations of debt financing: Debt/Assets After-Tax Cost of Debt Cost of Equity 0 %...
-
Monte Carlo study. As an aid to understanding the probit model, William Becker and Donald Waldman assumed the following: E(Y | X) = 1 + 3X Then, letting Y i = 1 + 3X + ε i , where...
-
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:...
-
a.-c. Repeat parts (a) through (c) of Problem 1 using the data of Problems 3 through 14 of Chapter 5.
-
Use the Ch08_AviaCo database shown in Figure P8.35 to work Problems 3546. Modify the MODEL table to add the attribute and insert the values shown in the following table. Table P8.35 Attribute and...
-
The Tip Calculator app does not need a Button to perform its calculations. Reimplement this app to use property listeners to perform the calculations whenever the user modifies the bill amount or...
-
A particle, carrying a positive charge of \(4 \mathrm{nC}\), located at \((5 \mathrm{~cm}, 0)\) on the \(x\)-axis experiences an attractive force of magnitude 115.2 \(\mathrm{N}\) due to an unknown...
-
A large-sized chemical company is considering investing in a project that costs `5,00,000. The estimated salvage value is zero; tax rate is 35 per cent. The company uses straight line method of...
-
From the following budgeted and actual figures, calculate and present the variances in respect of profit on sales and cost of sales. Budget: Sales, 2,000 units @ 15 each Cost of sales @ 12 each...
-
James and Anna Nesbit were contemplating divorce. They entered into a property settlement agreement, but James died before the divorce became final. His will provided a greater amount of property for...
-
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...
-
SkyChefs, Incorporated, prepares in-flight meals for a number of major airlines. One of the company's products is grilled salmon with new potatoes and mixed vegetables. During the most recent week,...
-
Tentacle Television Antenna Company provided the following manufacturing costs for the month of June. Direct labor cost $132,000 Direct materials cost 84,000 Equipment depreciation (straight-line)...
-
At the beginning of the year, Vendors, Inc., had owners' equity of $48,875. During the year, net income was $5,275 and the company paid dividends of $3,775. The company also repurchased $7,625 in...
Study smarter with the SolutionInn App