Find Us On: Facebook Twitter Rss Feed Blog
Need To Register? Sign Up Login

COP2551 Project 4 - myTunes

Lindt
Lindt 


See attached file for details Attachments Tags Clarifications

Answers

COP2551 Project 4 - myTunes - Solution

dickersonka
dickersonka 



Attached is the solution to the COP2551 Project 4 - myTunes assignment including source and comments . Make sure to pass in command line arguments to start the program.
Project4 songdata.txt
Attachments
myTunes.zip (4 K) Download
Preview
private Song song; /** * Create album * @param infoArray song data */ public Album(String[] infoArray){ name = infoArray[1]; releaseYear = infoArray[2]; genre = infoArray[3]; song = new Song(infoArray); } /** * Get album name

Preview
dashed lines String header = album.getSong().getSongNameHeader(false); header += album.getSong().getRunningTimeHeader(false); header += Convert.toPaddedString("Artist", ARTIST_NAME_LENGTH); header += album.getAlbumNameHeader(false); header += album.getSong().getTrackInfoHeader(false); header += album.getGenreHeader(false); header += album.getReleaseYearHeader(false); return header; } } /** * Create song info

Preview
} return s; } /** * Create padded string * @param s string to pad * @param length total length of string * @return padded string */ public static String toPaddedString(String s, int length){

Preview
data * @param fileName file to load from * @return true if successfully read file */ private static boolean loadData(String fileName){ boolean successful = false; try { //create reader for file BufferedReader reader = new BufferedReader(new FileReader(fileName)); boolean printedHeaders

Preview
return Convert.toDashedString(RUNNING_TIME_LENGTH); else return Convert.toPaddedString("Running Time", RUNNING_TIME_LENGTH); } /** * Get song name * @return song name */ public String getSongName(){ return Convert.toPaddedString(name, SONG_NAME_LENGTH); } /** * Get song name header * @param printDashedLine print

Preview
track info */ public String getTrackInfo(){ return Convert.toPaddedString(trackInfo, TRACK_INFO_LENGTH); } /** * Get track info header * @param printDashedLine print dashed line * @return track info

Preview
'Em,1990,Hip Hop,2,13,Can't Touch This,4:17 Abba,Arrival,1976,Pop,2,10,Dancing Queen,3:51 Moby,18,2002,Rock,9,18,Extreme Ways,3:58 Chicago,Chicago VI,1973,Rock,10,10,Feelin' Stronger Every Day,4:14 David Bowie,Station to Station,1976,Rock,2,6,Golden Years,3:30 Kiss,Animalize,1984,Hard Rock,2,9,Heaven's On Fire,3:21 Meat Loaf,Bat Out of Hell II: Back into Hell,1993,Rock,1,11,I'd Do Anything For Love,7:52 House of Pain,House of Pain,1992,Hip Hop,2,18,Jump Around,3:38 Carl Douglas,Kung Fu

Screenshots
Purchase Answer