Create a program that implements a music playlist using structures and files. The program must continue to run until the

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Create a program that implements a music playlist using structures and files. The program must continue to run until the

Post by answerhappygod »

Create A Program That Implements A Music Playlist Using Structures And Files The Program Must Continue To Run Until The 1
Create A Program That Implements A Music Playlist Using Structures And Files The Program Must Continue To Run Until The 1 (2.12 MiB) Viewed 10 times
expected program output:
Successfully loaded data!
======= MENU =======
[1] Add Playlist
[2] Add Song to Playlist
[3] Remove Song from Playlist
[4] View a Playlist
[5] View All Data
[6] Exit
Enter choice: 3
There are no playlists yet!
-----------------------------
======= MENU =======
[1] Add Playlist
[2] Add Song to Playlist
[3] Remove Song from Playlist
[4] View a Playlist
[5] View All Data
[6] Exit
Enter choice: 1
Enter playlist name: Taylor <3
Successfully added playlist!
-----------------------------
======= MENU =======
[1] Add Playlist
[2] Add Song to Playlist
[3] Remove Song from Playlist
[4] View a Playlist
[5] View All Data
[6] Exit
Enter choice: 1
Enter playlist name: Favorites <3
Successfully added playlist!
-----------------------------
======= MENU =======
[1] Add Playlist
[2] Add Song to Playlist
[3] Remove Song from Playlist
[4] View a Playlist
[5] View All Data
[6] Exit
Enter choice: 1
Enter playlist name: Taylor <3
Playlist name already exists!
-----------------------------
======= MENU =======
[1] Add Playlist
[2] Add Song to Playlist
[3] Remove Song from Playlist
[4] View a Playlist
[5] View All Data
[6] Exit
Enter choice: 5
PLAYLIST: Taylor <3
SONG COUNT: 0
PLAYLIST: Favorites <3
SONG COUNT: 0
-----------------------------
======= MENU =======
[1] Add Playlist
[2] Add Song to Playlist
[3] Remove Song from Playlist
[4] View a Playlist
[5] View All Data
[6] Exit
Enter choice: 2
THE PLAYLIST AVAILABLE ARE:
[0] Taylor <3
[1] Favorites <3
Enter playlist number: 3
Invalid playlist!
-----------------------------
======= MENU =======
[1] Add Playlist
[2] Add Song to Playlist
[3] Remove Song from Playlist
[4] View a Playlist
[5] View All Data
[6] Exit
Enter choice: 2
THE PLAYLIST AVAILABLE ARE:
[0] Taylor <3
[1] Favorites <3
Enter playlist number: 0
Enter song title: Sparks Fly
Enter song artist: Taylor Swift
Enter song album: Speak Now
Successfully added song to playlist!
-----------------------------
======= MENU =======
[1] Add Playlist
[2] Add Song to Playlist
[3] Remove Song from Playlist
[4] View a Playlist
[5] View All Data
[6] Exit
Enter choice: 2
THE PLAYLIST AVAILABLE ARE:
[0] Taylor <3
[1] Favorites <3
Enter playlist number: 0
Enter song title: Invisible String
Enter song artist: Taylor Swift
Enter song album: folklore
Successfully added song to playlist!
-----------------------------
======= MENU =======
[1] Add Playlist
[2] Add Song to Playlist
[3] Remove Song from Playlist
[4] View a Playlist
[5] View All Data
[6] Exit
Enter choice: 5
PLAYLIST: Taylor <3
SONG COUNT: 2
SONG TITLE: Sparks Fly
SONG ARTIST: Taylor Swift
SONG ALBUM: Speak Now
SONG TITLE: Invisible String
SONG ARTIST: Taylor Swift
SONG ALBUM: folklore
PLAYLIST: Favorites <3
SONG COUNT: 0
-----------------------------
======= MENU =======
[1] Add Playlist
[2] Add Song to Playlist
[3] Remove Song from Playlist
[4] View a Playlist
[5] View All Data
[6] Exit
Enter choice: 4
THE PLAYLIST AVAILABLE ARE:
[0] Taylor <3
[1] Favorites <3
Enter playlist number: 0
PLAYLIST: Taylor <3
SONG COUNT: 2
SONG TITLE: Sparks Fly
SONG ARTIST: Taylor Swift
SONG ALBUM: Speak Now
SONG TITLE: Invisible String
SONG ARTIST: Taylor Swift
SONG ALBUM: folklore
-----------------------------
======= MENU =======
[1] Add Playlist
[2] Add Song to Playlist
[3] Remove Song from Playlist
[4] View a Playlist
[5] View All Data
[6] Exit
Enter choice: 3
THE PLAYLIST AVAILABLE ARE:
[0] Taylor <3
[1] Favorites <3
Enter playlist number: 1
Playlist is still empty!
-----------------------------
======= MENU =======
[1] Add Playlist
[2] Add Song to Playlist
[3] Remove Song from Playlist
[4] View a Playlist
[5] View All Data
[6] Exit
Enter choice: 3
THE PLAYLIST AVAILABLE ARE:
[0] Taylor <3
[1] Favorites <3
Enter playlist number: 0
THE SONG AVAILABLE ARE:
[0] Sparks Fly by Taylor Swift
[1] Invisible String by Taylor Swift
Enter song number to delete: 3
Invalid song number!
-----------------------------
======= MENU =======
[1] Add Playlist
[2] Add Song to Playlist
[3] Remove Song from Playlist
[4] View a Playlist
[5] View All Data
[6] Exit
Enter choice: 3
THE PLAYLIST AVAILABLE ARE:
[0] Taylor <3
[1] Favorites <3
Enter playlist number: 0
THE SONG AVAILABLE ARE:
[0] Sparks Fly by Taylor Swift
[1] Invisible String by taylor Swift
Enter song number to delete: 0
Successfully deleted song!
-----------------------------
======= MENU =======
[1] Add Playlist
[2] Add Song to Playlist
[3] Remove Song from Playlist
[4] View a Playlist
[5] View All Data
[6] Exit
Enter choice: 3
THE PLAYLIST AVAILABLE ARE:
[0] Taylor <3
[1] Favorites <3
Enter playlist number: 0
THE SONG AVAILABLE ARE:
[0] Invisible String by taylor Swift
Enter song number to delete: 0
Successfully deleted song!
-----------------------------
======= MENU =======
[1] Add Playlist
[2] Add Song to Playlist
[3] Remove Song from Playlist
[4] View a Playlist
[5] View All Data
[6] Exit
Enter choice: 5
PLAYLIST: Taylor <3
SONG COUNT: 0
PLAYLIST: Favorites <3
SONG COUNT: 0
-----------------------------
Create a program that implements a music playlist using structures and files. The program must continue to run until the user picks exit. Functionalities: 1. Create two structures. One for the playlist with the details: name, song count, array of songs (size 10) and one for the song with the details: title, artist, album. 2. The program must load the data each time it is ran and must save the data each time the user picks exit. (a) Save Data You must check whether there is a data to be saved. If there are none, simply print a prompt saying so. Also, save count as 0 so that you will be able to keep track if file is empty. The format of the saved data must follow this: Total Count of the Playlists Name of Playlist 1. Number of Songs in Playlist 1 Title of Song 1 Artist of Song 1 Album of Song 1 Title of Song 1 Artist of Song 1 Album of Song 1 Name of Playlist 2 Number of Songs in Playlist 2 Load Data You must check whether the file exists. If the file exists, check if the count is 0. If the count not 0, read each of the data in the file and save it in array of structures. The user can put up to 10 playlists in the system. Make sure to check if the system is not yet full. If the system is not yet full, ask for the details of the playlist, and initiallize the song count to 0. Remember to check that the name of the playlist is unique. If the name already exists, it musn't be added to the system. If the system is full, simply say that it is. (b) 3. Create a menu that shows: (a) Add Playlist (b) Add Song to Playlist Make sure to check if there a playlist to add to. Ask which playlist to add the song to. If the playlist exists and it doesn't have 10 songs yet, ask for the details of the song. Else, print the appropriate prompts. (c) Remove Song from Playlist Make sure to check if there is a playlist to remove from. Ask which playlist to remove songs from. If the playlist exists, and it isn't empty, ask which song to remove. If found, remove the song. Else, print the appropriate prompts. (d) View a Playlist Make sure to check if there is a playlist to print. Ask which playlist to print. If the playlist exists, print all the details about it along with the songs. Else, print the appropriate prompts. (e) View all Data This simply prints all of the available data in the system. Both the playlists and songs. Make sure to check if there is data to print. (f) Exit - When the user picks this, the program terminates. 4. Each choices except for the exit must be implemented inside a function. You also need to put save () and load() inside a function. 5. Do not forget to put documentation in your code.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply