Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write an interactive Java program that prompts for and reads two strings each containing distinct characters [Note: You are not required to check this, assume
Write an interactive Java program that prompts for and reads two strings each containing distinct characters [Note: You are not required to check this, assume each string input has distinct characters]. The program then creates a string which is the intersection of the two input strings. If the intersection is empty, the following is displayed: The intersection is Note: The behaviour of your program must be similar to the sample program runs below: Sample program runs Enter string1 of distinct characters: best road Enter string2 of distinct characters: this boy. The intersection is: bst o. Enter stringi of distinct characters: black pen Enter string2 of distinct characters: redpot The intersection is: pe Enter string1 of distinct characters: Enter string2 of distinct characters: The intersection is: JAVA Enter stringl of distinct characters: qwerty Enter string2 of distinct characters: OWERTY Enter stringl of distinct characters: q Enter string2 of distinct characters: The intersection is empty: h JAVA AVA qwerty QWERTY
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