Instructions: Kindly create a C language program and refer for the expected program output below: (I won't like your solution if there is any error, not properly debugged.)   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

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 1TF: Mark the following statements as true or false. A double type is an example of a simple data type....
icon
Related questions
icon
Concept explainers
Question

Instructions: Kindly create a C language program and refer for the expected program output below: (I won't like your solution if there is any error, not properly debugged.)

 

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.
Transcribed Image Text: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.
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Operators
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage