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.
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
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 72% (11 reviews)
import javautilScanner public class Exercise0422 public static void mainStr...View the full answer
Answered By
Utsab mitra
I have the expertise to deliver these subjects to college and higher-level students. The services would involve only solving assignments, homework help, and others.
I have experience in delivering these subjects for the last 6 years on a freelancing basis in different companies around the globe. I am CMA certified and CGMA UK. I have professional experience of 18 years in the industry involved in the manufacturing company and IT implementation experience of over 12 years.
I have delivered this help to students effortlessly, which is essential to give the students a good grade in their studies.
3.50+
2+ Reviews
10+ Question Solved
Related Book For
Introduction To Java Programming And Data Structures Comprehensive Version
ISBN: 9780136520238
12th Edition
Authors: Y. Daniel Liang
Question Posted:
Students also viewed these Computer science questions
-
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 sl: ABCD Enter string s2: BC substring of ABCD -...
-
Write a program that prompts the user to enter three strings. Compare the String objects lexicographically and print the middle-valued string. For example, if the three strings were "abcd", "wxyz",...
-
Write a program that prompts the user to enter an integer for today?s day of the week (Sunday is 0, Monday is 1, ?, and Saturday is 6). Also prompt the user to enter the number of days after today...
-
Jobs A, B, and C are waiting to be started on Machine Center X. When they are finished at this center, they must be moved to Machine Center Y for final processing. Machine capacity for both centers...
-
Put the following model in standard state-variable form and obtain the expressions for the matrices A, B, C, and D. The output is x. 2 + 5 + 4x = 4y(t)
-
Lydia Hartley, manager of UltraProducts New Zealand Division, is trying to set the production schedule for the last quarter of the year. The New Zealand Division had planned to sell 100,000 units...
-
In the benzene adsorber of Example 9.7, the flow rate is increased to \(0.25 \mathrm{~m}^{3} / \mathrm{s}\). Calculate the breakthrough time and the fraction of the bed adsorption capacity that has...
-
On January 1, 2011, Adams Corporation signed a 5-year non-cancelable lease for a machine. The terms of the lease called for Adams to make annual payments of $9,968 at the beginning of each year,...
-
A clinical resear would like to know if his diet program is effective in lowering patients blood pressure. The following patient. Blood pressure before diet blood pressure after diet 1. 15. 12 2. 15....
-
Leisure City has an Electric Utility Enterprise Fund (EUEF) that provides electric power to its residents and to city agencies. Following is the EUEF opening trial balance at January 1, 2013 (all...
-
A school has 100 lockers and 100 students. All lockers are closed on the first day of school. As the students enter, the first student, denoted as S1, opens every locker. Then the second student, S2,...
-
Write a program that displays a 10-by-10 square matrix, as shown in Figure 14.45a. Each element in the matrix is 0 or 1, randomly generated. Display each number centered in a text field. Use...
-
A vacuum cleaner belt is looped over a shaft of radius 0.45 cm and a wheel of radius 2.00 cm. The arrangement of the belt, shaft, and wheel is similar to that of the chain and sprockets in Fig. 9.14....
-
Assume that there are only three countries in the world: Amazonia, Babylonia and Carthaginia. Amazonia has a current account deficit of 20 and Babylonia has a financial account surplus of 30. a....
-
1. Write the pseudocode that represents the code (No code allowed) 2. Create a table of steps to describe how the pseudocode behaves for any given n. Show all work. 3. Compute the complexity function...
-
Two property developers, Classical Land and Keynes Development, are contemplating launching their properties for sales around the months of June or July. If both launch their properties in June, both...
-
Aamir's company has the production function Q=8K^0.75L^0.25, where Q measures output, K measures machine hours, and L measures labor hours. Suppose that the rental rate of capital is R=$120, the wage...
-
A block of mass m = 8,8 kg slides on a rough surface and moves toward a spring with a spring constant k = 2135 N/m, as shown in the figure below. When the block is d = 11m away from the spring, it...
-
A point source of light is in front of a plane mirror. (a) Prove that all the reflected rays, when extended back behind the mirror, intersect in a single point. (b) Show that the image point lies on...
-
What are the main distinctions between the different schools of legal interpretation?
-
? can be computed using the following series: Write a method that returns?m(i)?for a given?i?and write a test program that displays the following table:i .......................m(i)1...
-
Write a method to compute the following series: Write a test program that displays the following table:i ........................m(i)1 ...................0.50002 ..................1.1667...19...
-
Write a method that prints characters using the following header: public static void printChars(char ch1, char ch2, int numberPerLine) This method prints the characters between ch1 and ch2 with the...
-
When a person stands on tiptoe fa strenuous position), the position of the foot is as shown in Figure a. The total gravitational force on the body. For is supported by the force n exerted by the...
-
Relational satisfaction Conceptual Definition - "Relational satisfaction is defined as...( your answer ) Three Likert Scale examples to measure relational satisfaction are...( your answer ) Three...
-
A number 12 copper wire has a diameter of 2.053 mm. Calculate the resistance of a 34.0 m long piece of such wire. (Use 1.72x10-8 m for the resistivity of copper.) Submit Answer Tries 0/15 For safety,...
Transactions On Computational Collective Intelligence XXV 1st Edition - ISBN: 3662535793 - Free Book
Study smarter with the SolutionInn App