jeudi 30 avril 2015

A java file processing assignment

I have to write a program that reads a file and basically categorize it in 3 separate categories. I am new to this and I do not know where to began. Any help with be appreciated. This is the question:

Write a program to process a file containing information about your music collection. Each song in your song library will have a name, artist, and length in seconds. Read this data into three arrays, two for strings (for title and artist) and one for integers (for length). Then perform the following processing.

Output the songs in a table
Determine and output the total length of all songs
Determine and output the longest song
Determine and output the shortest song
Output the song titles in alphabetical order  

I already have the file created and its formatted like:

5

212:Float On:Modest Mouse

259:Cherub Rock:Smashing Pumpkins

512:Won't Get Fooled Again:The Who

417:Teen Age Riot:Sonic Youth

299:PDA:Interpol

These are the required methods we must use:

Arrays: sort

String: split

Integer: parseInt

Aucun commentaire:

Enregistrer un commentaire