Question: In the following program skeleton, replace the code here> line with appropriate code. The resulting program should prompt the user for some identifying text, like
- In the following program skeleton, replace the code here> line with appropriate code. The resulting program should prompt the user for some identifying text, like the artist’s name. Then it should display all lines in the songs string that contain that identifying text. Study the sample session.
![import java.util.Scanner: public class PrintSong ( public static void main(String[] args) ( Scanner stdIn new](https://dsd5zvtm8ll6.cloudfront.net/images/question_images/1704/7/8/2/818659cebe2866941704782816509.jpg)
import java.util.Scanner: public class PrintSong ( public static void main(String[] args) ( Scanner stdin new Scanner (System.in); String songs - "1. Welcome to Your Life Grouplove " + "2. Sedona Houndmouth " + "3. Imagine John Lennon " + "4. Bohemian Rhapsody Queen "; String song: String text: int numIndex; int endIndex; int textIndex: // description of next song // text searched for // index of song number // index of end of current song // position of text } // end main // end class PrintSong Sample session: Enter identifying Text: Lennon 3. Imagine John Lennon
Step by Step Solution
3.42 Rating (152 Votes )
There are 3 Steps involved in it
Based on your prompt you need to write code for a Java program that filters and prints lines of a st... View full answer
Get step-by-step solutions from verified subject matter experts
