Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a program which reads two Strings of any length from the console and displays the following information about the strings: bullet Display the number
Write a program which reads two Strings of any length from the console and displays the following information about the strings: bullet Display the number of characters in each String. bullet Display whether the first string is a substring of the second. If the first string is a substring of the second, display where the string appears (in the beginning, middle, or end). bullet Display whether the second string is a substring of the first. If the second string is a substring of the first, display where the string appears (in the beginning, middle, or end). bullet Display if the two strings are equal or not. If the two strings are not equal, say whether or not the first string is alphabetically less than or greater than the second string. Input Validation: bullet No validation required. Requirements: bullet All comparisons must ignore the case of the string. Sample Output 1: Enter the first string: abcde Enter the second string: abcde "abcde" has 5 characters. "abcde" has 5 characters. "abcde" is a substring of "abcde" and appears at the beginning, middle, and end of the string. "abcde" is a substring of "abcde" and appears at the beginning, middle, and end of the string. "abcde" and "abcde" are equal
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started