Question: I need to use C struct to represent data and incrementally develop/test code for creating and managing mp3 song database. a. The maximum number of

I need to use C struct to represent data and incrementally develop/test code for creating and managing mp3 song database.

a. The maximum number of songs in the database is 30. An array of structs should be used to represent the database.

b. Each mp3 song has the following information. A C struct should be used to represent the song. The members of the struct are the below attributes.

Title of the song - A string with at most 40 characters

Artist names - Maximum of three artists, Each name is at most 20 characters

Song release date - Three fields specify date - mm/dd/yyyy (month/day/year)

Genre of song - Country or Blues or Rock or Heavy metal or Hip-Hop. Feel free to add more, if you desire.

3. Populate database - Create a function to initially insert a given number of songs with the information in Step 2 into the database. This function must take the number of songs and the array of structs in step 2 as input parameters.

4. Search database - Create a function to search the database for a song, given the title name. If the song is not found, print an error message to inform the user otherwise print all information about the song as given in Step 2. The entire title is provided for searching.

5. Insert into database - Create a function to insert a new song into the database. Note that this is a similar function to Step 3 but can be called at a later time in the code. Insertion of new song happens at the end of the current list of songs in the database. If database is full, print an error message to inform the user and do not insert the new song.

6. Delete from database - Create function to delete a song from the database, given the entire title of song. If the song to be deleted happens to be not at the end of the list, shift the list to "close the hole" in the list. (The struct array holding the list of songs should not have any empty spaces other than at the end of the list). To delete a song in the array which is not at the end of the list, simply shift subsequent array elements.

7. Contents of database Create a function to list the contents of the database by displaying titles of all songs currently in the database.

8. Error checking - Appropriate error checking should be done if needed for each step above.

9. Welcome Menu - All the above steps (except step 8) should be displayed as a menu to the user. The menu should ask for which operation the user would like to choose or if the user would like to quit the program. Based on user choice, one of the above steps must be executed and the menu should be displayed again.

10. You may use other parameters for the above functions as required by your design. No global variables may be used.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!