I need help to compelet this code, after the ( //TODO ) I have to insert the correct code.
PLEASE, NOT you are not allowed to change or add anything to this code just compelet what the questione is asking for .
Assignment05 + HLN Eds CSE240 – Programming Languages Spring 2023 Assignment 05 Description The aim of this assignment is to make sure that you understand and are familiar with the concepts covered in the lectures, including basic C syntax, using structures and enumeration types, pointer operations, linked list, and memory leak. To complete this assignment: • You need to have access to general.asu.edu UNIX server. If you don’t have access to it yet, please check the tutorial available in Canvas covering this topic. • You can use any IDE to create the programs of this assignment; however, your code should compile in gcc in general.asu.edu. Thus, before submitting your code, make sure that it compiles and produces the expected output while compiling it with gcc in general.asu.edu. • You are encouraged to ask and answer questions on the course Discussion board. However, do not share your answers or code in the course discussion board. You are allowed to share just a couple lines of code but not more than that. Do not cooperate with your peers in doing the individual assignments. Programming Exercise (100 points) 1. For this program you will complete the program in the a05.c file. Find the places in the code marked with the ToDo label and complete the work. You should not change any other part of the code. This includes do not add any global variables or any other function. The program declares a struct ‘musicRepository’ with elements for song’s ID, song’s name, singer’s name, genre of the song, and song’s year. You will be completing a program that creates a list of songs (array of structs). It is a menu-driven program where the user is given the following options: • Add a song to the repository - always inserted in the next available space in the array. The next available array might not be next to the last song added, it might be somewhere in the middle. Check Delete function below for details. If there is no space to add a new song, the function should return -1, and 1 otherwise. • Search song by name - given the name of the song, return the struct with the data of the song. • Print a song - given a struct print its content. Please note that the Genre is an enum type; however, the print function should print a string, not a number for this field. • Edit a song - given the name of the song, find it (using the Search function above), and modify any of the fields of the song except ID. ID cannot be edited, and all fields should have a valid value. • Delete a song - given the name of the song, find it (using the Search function above), and modify the fields of the song (using the Edit function above), making ID, Year, and Genre 0, and name and author an empty string. Return -1 if the song was not found, 1 if it was deleted. • Print the whole list of songs. Print the list of songs including all the fields of the song except for ID. Create a PDF file named “a05”. Create a section in this document called Program 01 and paste your screenshots of the compilation results under this section for program 1. 2. Based on the previous problem, you should implement this second problem in the same file a05.c. Find the places in the code marked with the ToDo label and complete the work. You should not change any other part of the code. This includes do not add any global variables or any other function. For this problem, we are reusing the same struct from problem 1, but adding a pointer to the struct to be able to create a linked list. In this problem, you must use linked list to create a user playlist (play_list). • The struct is holding the information of a song: ID, Name, Singer, Genre, Year, and the pointer Next (the pointer to the struct). • There should be the following functions. In the similar way we have done in previous assignments, complete the following functions: o Add a song to the play_list - always inserted at the end of the list. Search song by name - given the name of the song, return the struct with the data of the song. o Edit a song - given the name of the song, find it in the play_list and modify any of the fields of the song (ID cannot be edited, and all fields should have a valid value). Return -1 if the song was not found. o Delete a song - given the name of the song, find it, delete the song from the play_list (i.e., disconnect the node from the list). Return -1 if the song was not found, 1 if it was deleted. Create a section in this document called Program02 and paste your screenshots of the compilation results under this section for program 2. You can find out more about these functions by reading through the instructions in the a05.c file. Note that even when the code in a05.c compiles and runs not all the functions are implemented; thus, some of the options in the main menu won’t too much now. You will see that there are some songs added in the repository and the play_list hardcoded, you should leave them there. Thus, at this point, what you can do is to print the content in the repository. Please see the test cases in the a05.c file and make sure that your program reads the values and show the outputs same as the expected outputs are. Submission You must create a ZIP file, name it a05.ZIPa with the following files only: • a05.c • a05.PDF Grading • Each problem has been assigned certain points. • For the problems related with code, your code should compile. If the code does not compile, you won’t get any points for that problem. • If the code compiles, we will use then our test cases to review the correctness of your code. • We will not debug programs to figure out the errors. • You can check the rubric for the assignment in Canvas.