Skip to content

Commit

Permalink
Merged our code together and removed all issues
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanoIaconetti committed Aug 20, 2020
1 parent 9f3c788 commit 2cafd53
Showing 1 changed file with 14 additions and 23 deletions.
37 changes: 14 additions & 23 deletions MusicPlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -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?");
Expand All @@ -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:
Expand Down Expand Up @@ -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);
Expand All @@ -140,6 +132,8 @@ public static void DisplayAlbums(PriorityQueue[] albumList) {
System.out.println(i + ". " + albumList[i].albumName);
}
}


}


Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand All @@ -302,5 +294,4 @@ public static int CheckInt(String parseInt) {
}
return 0;
}
>>>>>>> AlbumInteraction
}

0 comments on commit 2cafd53

Please sign in to comment.