Reference no: EM132756097
Java Assignment -
Learning Objectives
Putting together a small project with input file and output file
If you choose Java, a review of Java concepts
- Java array type, and 2D arrays
- Creating classes, and instantiating them
Problem Description - A record label executive received text files that contain the top streamed music artists during certain weeks. In order for their in house IT to be able to process the information, they need someone to help process it.
Data Representation - Each file is a text file (data comes from SpotifyCharts.com) in comma separated value (CSV) format. It contains a list of records, line by line, column delimiters are written with a , symbol. Each record is one track by an artist (one track means one song). An artist's name might appear multiple times in a single file.
Each text file is a comma separated value (CSV) file that has a few columns like the following table. Each line in the text file represents one song.
Create a Report: 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. Assuming you don't know any data structures yet, it seems the way to proceed to find the answer is with Java arrays.
1. Read in the text file and then save the fields into a nested Java array like myList below.
/* 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 can discuss your decision with your class colleagues.
2. If an artist appears multiple times, then that artist probably should only appear once in your nested array.
3. Prepare an output file with contents of your nested array so that the record label executive can see this report.
Create a Report: Who appears on the top streamed list?
1. First, the exec wants to know which artists appears on the list and how many times they appear. Assuming you don't know any data structures yet, it seems the way to proceed to find the answer is with Java arrays.
1. Read in the text file and then save the fields into a nested Java array like myList below.
/* 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]);
2. Prepare an output file with contents of your nested array so that the record label executive can see this report.
3. If an artist appears multiple times, then that artist probably should only appear once in your nested array.
4. Alphabetize the names of artists produced
5. Return list of artists produced