Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need guidance on formulating this program. let me know if you need to reference the lab 6 song class CSC 212 -Principles of Programming
I need guidance on formulating this program. let me know if you need to reference the lab 6 song class
CSC 212 -Principles of Programming Homework Assignment 5 Write a Java program that can read a comma-separated value (CSV) file containing information about songs, store these in an array of song objects, and perform search functions. The file can be found here Save this file in the main directory for your Netbeans project, as you did for Lab 5. The example below shows the interaction. Desian Make sure that your program uses a Java package called 'csc212hw05'. Your program should consist of the following classes. Main . Read a file called "songs.csv" containing 4456 songs. Use each line of the file to create a Song object, then place it in an array of Song objects o Note: You should declare your array to hold exactly 4456 Song objects. o Hint: Use the split method in the string class to split the input line on the comma. The result is a small array with the artist, title, and year as elements . Read input from the user to get search commands. Hint: When searching, use a for loop to iterate through the array of Song objects Hint: Use the indexof) method in the string class to do partial matching on the title and artist o o Process commands as shown in the example Song Very similar to the Song class used in Lab 6, except that we will add a String variable called year. All variables should be declared as private Write a constructor that accepts three parameters: a String for the artist, a String for the title, and a String for the year and uses these to initialize the variables. Write the following public methods . . o getTitle the song o getArtist accepts no parameters. The method should return the title of accepts no parameters. The method should return the artist performing the song. o toString -accepts no parameters. It returns the artist, title, and year concatenated as shown in the example belowStep 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