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)
-
1. Your savings account pays 4 percent per year: Each $100 in the bank grows to $104 over a one-year period. If prices increase by 3 percent per year, by keeping $100 in the bank for a year you...
-
On December 31, 2005, Klimek Co.s records show the following results for the year: Required Cash sales... Credit sales $1,015,000 1,241,000 In addition, its unadjusted trial balance includes the...
-
Describe the layout of a typical fast-food franchise such as McDonalds. What type of layout is it? How does it support productivity? Do different franchises (e.g., Burger King or Wendys) have...
-
During 2019 and 2020, Faulkner Manufacturing used the sum-of-the-years-digits (SYD) method of depreciation for its depreciable assets, for both financial reporting and tax purposes. At the beginning...
-
a. Draw a UML class diagram that describes the Tablet Store's purchases and payments process. b. Using Microsoft Access, implement a relational database from your UML class diagram. Identify at least...
-
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...
-
In Exercises the rectangular coordinates of a point are given. Plot the point and find two sets of polar coordinates of the point for 0 < 2. (-1, 3)
-
Weiland Company is subject to a 21% tax rate and reported the following items below related to its 2024 income tax calculations. How much is income tax expanse in 2024? 2024 taxable income Deferred...
-
Pitman Company is a small editorial services company owned and operated by Jan Pitman. On October 31, 2019, the end of the current year, Pitman Company's accounting clerk prepared the followin Pitman...
-
How do historical legacies and institutional inertia shape the trajectory of organizational culture, and what interventions can leaders implement to catalyze cultural transformation and navigate...
-
How do emergent technologies such as virtual collaboration platforms and AI-driven analytics reshape the dynamics of distributed teams, and what strategies can leaders employ to optimize virtual team...
-
Now assume that during 2023, Karane decides to buy a competitor's assets for a purchase price of $1,350,000. Compute the maximum 2023 cost recovery, including $179 expense and bonus depreciation....
-
Explain how the credit crisis adversely affected many other people beyond homeowners and mortgage companies. Do you believe the impact of the credit crisis is still being felt today?
-
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...
-
Comparative Balance Sheets June 30, 2019 and 2018 2019 2018 Assets Cash Accounts receivable, net Inventory Prepaid expenses Total current assets Equipment Accum. depreciation-Equipment Total assets...
-
A company issued 10-year, 7.75% bonds with a face value of $100,000. The company received $97,817 for the bonds. Using the straight-line method of amortization, the amount of interest expense for the...
-
Single Plantwide Factory Overhead Rate Scrumptious Snacks Inc. manufactures three types of snack foods: tortilla chips, potato chips, and pretzels. The company has budgeted the following costs for...
Study smarter with the SolutionInn App