From 2cafd5328911cb5376e12b0fb7a0f7424dc22280 Mon Sep 17 00:00:00 2001 From: Stefano Iaconetti Date: Wed, 19 Aug 2020 22:27:01 -0400 Subject: [PATCH] Merged our code together and removed all issues --- MusicPlayer.java | 37 ++++++++++++++----------------------- 1 file changed, 14 insertions(+), 23 deletions(-) diff --git a/MusicPlayer.java b/MusicPlayer.java index aec3370..f6c7d8f 100644 --- a/MusicPlayer.java +++ b/MusicPlayer.java @@ -52,7 +52,7 @@ public static void main(String[] args){ case 3: //Displays all the current albums DisplayAlbums(albumList); -<<<<<<< HEAD + break; case 4: //Ask the user what statistic they would like to enter System.out.print("What statistics would you like?"); @@ -61,11 +61,7 @@ public static void main(String[] args){ //Displays statistics to user Statistics(albumList, statInt); -======= break; - case 4: - break; ->>>>>>> AlbumInteraction case 5: break; default: @@ -116,14 +112,10 @@ public static void AlbumEnter(PriorityQueue[] albumList, int entry) { //Displays all the songs in the current album public static void DisplaySongs(PriorityQueue[] albumList, int entry) { -<<<<<<< HEAD - System.out.println("Current Albums: "); //Loops through the songs of the array in the priority queue -======= System.out.println("Album: " + albumList[entry].albumName + "\n"); System.out.println("Current Songs: "); //Loops through the songs of the arrayin the priority queue ->>>>>>> AlbumInteraction for(int i = 0; i < 30; i++) { if(albumList[entry].queueArray[i] != null) { System.out.println(i + ". " + albumList[entry].queueArray[i].song.name); @@ -140,6 +132,8 @@ public static void DisplayAlbums(PriorityQueue[] albumList) { System.out.println(i + ". " + albumList[i].albumName); } } + + } @@ -169,8 +163,17 @@ public static void AddSong(PriorityQueue[] albumList, int entry) { length = CheckDouble(input.nextLine()); -<<<<<<< HEAD - } + if(length != 0) { + //Adding song into priority queue + Song song = new Song(songName, artist, genre, length); + albumList[entry].enqueue(song, albumList[entry].prority); + AlbumEnter(albumList, entry); + }else { + System.out.println("Please enter a valid song length"); + AlbumEnter(albumList, entry); + } + } + public static void Statistics(PriorityQueue[] albumList, int entry){ //Scanner @@ -268,17 +271,6 @@ public static void TotalAlbumLength(PriorityQueue[] albumList, int entry){ System.out.println(totalLength); } -======= - if(length != 0) { - //Adding song into priority queue - Song song = new Song(songName, artist, genre, length); - albumList[entry].enqueue(song, albumList[entry].prority); - AlbumEnter(albumList, entry); - }else { - System.out.println("Please enter a valid song length"); - AlbumEnter(albumList, entry); - } - } public static double CheckDouble(String parseDouble) { @@ -302,5 +294,4 @@ public static int CheckInt(String parseInt) { } return 0; } ->>>>>>> AlbumInteraction } \ No newline at end of file