Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please write the following program in Java and add detailed comments so i can understand what is happeneing. Problem Description A record label executive received
Please write the following program in Java and add detailed comments so i can understand what is happeneing.
Problem Description A record label executive received text files that contain the top streamed music artists during certain weeks. Each file represents one track by an artist. An artist's name might appear multiple times. The data comes from Spotify Charts 4. In order for their in house IT to be able to process the information, they need someone to help process it. Each text file is a comma separated value (CSV) file that has a few columns like the following table : Position Track Name Artist Streams URL 1 One Dance 100 - Drake, Wizkid Kyla 2 Lean On 99 . Major Lazer, MO, DJ Snake 98 Sunflower - Spider-Man: Into the Spider-Verse Post Malone Swae Lee Somebody That I Used to know Gotye, Kimbra Adele Rolling in the Deep Because it's a CSV file, column delimiters are written with a, symbol. Each line in the text file represents one song. Position, "Track Name" Artist, Streams URL Who appears on the top streamed list? First, the exec wants to know which artists appears on the list and how many times they appear. Prepare an output file with contents of your nested array so that the record label executive can see this report. o Link to Data Extract 1 o Link to Data Extract 2 Not knowing data structures yet, it seems the way to proceed quickly at building is with Java arrays. Read in the text file and then save the CSV file format into a nested Java array like myList below. If an artist appears multiple times, then that artist probably should only appear once in your nested array Java /* Java nested array syntax */ int cols = 4; // arbitrary number represents columns to create int rows = 10; // arbitrary number represents rows to create; String[][] myList = new String[rows] cols]; int[] arr = {{1,2}, {3,4} }; System.out.println("arr[0][0] = " + arr[0][0]); Will you limit to just the artist name? Perhaps you should discuss your decision with your class colleagues. Who are the music artists in alphabetical order)? It just so happens that this imaginary VIP client has a thing for alphabetized lists and wants to see the artist names in alphabetical order. Since you learned about linked lists in class, you should know how to create one. You can probably take the array from part 1, which is hopefully a truncated version of the raw data, and insert artist names into a sorted linked list. You may use the example classes below to start with to design a sorted list of TopStreamingArtists. You may also create your own classes. The classes work like templates because they offer a blueprint, where you can reuse the object oriented structure by creating objects from those classes 1 Anode represents an artist class Artist private String name: private Artist next; Wadd constructors * The List TopStreaming Artists is composed of a series of artist names class TopStreaming Artists private Artist first: public void TopStreaming Artists first- null: public boolean isEmpty return (first- null); Using the linked list structure you've designed and created, you can resume with the data processing in order to provide another report to the insert an artist name to the TopStreamingArtists linked list. public static void main(String[] args) Top Streaming Artists artistNames = new TopStreaming Artists: artistNames.insert("Stage Name"); artistNames.displayList(); Make sure to print out the report for the exec showing the data in ascending order by Artist name 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