Reupload of previous question with csv format and struct requirements included
Here is the csv formatting
the quotes must be removed when storing in struct and returned when printing file
This is the required struct format
Your DMM program must have a text-based interface which allows the user to select from a main menu of options including: (1) load, (2) store, (3) display, (4) insert, (5) delete, (6) edit, (7) sort, (8) rate, (9) play, (10) shuffle, and (11) exit. For Part 1 of the assignment, you will only need to complete the main menu, (1) load, (2) store, (3) display, (6) edit, (8) rate, (9) play, and (11) exit features. The other features will be completed in the next part of the assignment. > What must the main menu contain? The main menu must display the following commands: (1) load (2) store (3) display (4) insert (5) delete (6) edit (7) sort (8) rate (9) play (10) shuffle (11) exit After a command is selected and completed, your program must display the main menu again. This procedure will continue until the "exit" command is selected. > What must "load" do? The "load" command must read all records from a file called musicPlayList.csv (you may find a sample file here) into a dynamic doubly linked list. The doubly linked list is considered the main playlist. As each record is read from the file, it must be inserted at the front of the list. Each record consists of the following attributes: Artist - a string Album title - a string Song title - a string Genre - a string Song length - a struct Duration type consisting of seconds and minutes, both integers Number times played - an integer Rating - an integer (1 - 5) Each attribute, in a single record, will be separated by a comma in the .csv (comma separated values) file. This means that you will need to design an algorithm to extract the required attributes for each record. Each field in each record will have a value. You do not need to check for null or empty values. You must define a struct called Record to represent the above attributes. Also, do not forget that the Song Length must be represented by another struct called Duration. Duration is defined as follows: Minutes - an integer Seconds - an integer Finally, each struct Node in the doubly linked list must be defined as follows: Data - a Record Pointer to the next node Pointer to the previous node Pointer to the previous node > What must "store" do? The "store" command writes the current records, in the dynamic doubly linked list, to the musicPlayList.csv file. The store will completely overwrite the previous contents in the file. What must "display" do? The "display" command prints records to the screen. This command must support two methods, one of which is selected by the user: 1. Print all records. 2. Print all records that match an artist. > What must "edit" do? The "edit" command must allow the user to find a record in the list by artist. If there are multiple records with the same artist, then your program must prompt the user which one to edit. The user may modify all of the attributes in the record. > What must "rate" do? The "rate" command must allow the user to assign a value of 1 - 5 to a song; 1 is the lowest rating and 5 is the highest rating. The rating will replace the previous rating. > What must "play" do? The "play" command must allow the user to select a song, and must start "playing" each song in order from the current song. "Playing" the song for this assignment means displaying the contents of the record that represents the song for a short period of time, clearing the screen and showing the next record in the list, etc. This continues until all songs have been played. > What must "exit" do? The "exit" command saves the most recent list to the musicPlayList.csv file. This command will completely overwrite the previous contents in the file. IV. Logical Block Diagram The logical block diagram for your doubly linked list should look like the following: Record 1: Artist Album title Song title Genre Song length Times played Rating Record 2: Artist Album title Song title Genre Song length Times played Rating Record n-1: Artist Album title Song title Genre Song length Times played Rating Record n: Artist Album title Song title Genre Song length Times played Rating As you can see from the illustration a doubly linked list has a pointer to the next node and the previous node in the list. The first node's previous node pointer is always NULL and the last node's next pointer is always NULL. When you insert and delete nodes from a doubly linked list, you must always carefully link the previous and next pointers. V. Submitting Assignments: 1. Using Blackboard Learn https://learn.wsu.edu/webapps/login/ submit your assignment. You will submit your assignment in the lab Blackboard space. Under the "Content" link navigate to the "Programming Assignment Submissions" folder and upload your solution to the appropriate "Assignment space. You must upload your solution, through an attachment, as
_pa2.zip by the due date and time. 2. Your project must contain at least one header file (a .h file), two C source files (which must be .c files), and a local copy of the .csv file. 3. Your project must build properly. The most points an assignment can receive if it does not build properly is 65 out of 100. |"Swift, Taylor", 1989, Shake it off, Pop, 3:35,12,3 Drake, NOTHING WAS THE SAME, Own it, Rap, 3:23,3,3 Drake, YOU WELCOME, The Motto, Rap, 4:13,7,4 "Perri, Christina", HEAD OF HEART, Trust, Pop, 2:35,3,5 "Bieber, Justin", PURPOSE, No Sense, Pop, 4:12,6,1 Eminem, SHADYXV, Vegas, Rap, 3:37,8,3 Adele, 25, Remedy, Pop, 4:11, 24,4 "Swift, Taylor", RED, Stay Stay Stay,Pop, 4:42,5,1 "Brooks, Garth", FRESH HORSES, The Old Stuff, Country,2:57,11,2 typedef struct duration { int minutes; int seconds; } Duration; typedef struct data { char artist [20]; char album[20]; char song [20]; char genre[20]; Duration songLength; int timesPlayed; int rating; } Data; typedef struct node { struct node* prev; Data record; struct node* next; } Node; Your DMM program must have a text-based interface which allows the user to select from a main menu of options including: (1) load, (2) store, (3) display, (4) insert, (5) delete, (6) edit, (7) sort, (8) rate, (9) play, (10) shuffle, and (11) exit. For Part 1 of the assignment, you will only need to complete the main menu, (1) load, (2) store, (3) display, (6) edit, (8) rate, (9) play, and (11) exit features. The other features will be completed in the next part of the assignment. > What must the main menu contain? The main menu must display the following commands: (1) load (2) store (3) display (4) insert (5) delete (6) edit (7) sort (8) rate (9) play (10) shuffle (11) exit After a command is selected and completed, your program must display the main menu again. This procedure will continue until the "exit" command is selected. > What must "load" do? The "load" command must read all records from a file called musicPlayList.csv (you may find a sample file here) into a dynamic doubly linked list. The doubly linked list is considered the main playlist. As each record is read from the file, it must be inserted at the front of the list. Each record consists of the following attributes: Artist - a string Album title - a string Song title - a string Genre - a string Song length - a struct Duration type consisting of seconds and minutes, both integers Number times played - an integer Rating - an integer (1 - 5) Each attribute, in a single record, will be separated by a comma in the .csv (comma separated values) file. This means that you will need to design an algorithm to extract the required attributes for each record. Each field in each record will have a value. You do not need to check for null or empty values. You must define a struct called Record to represent the above attributes. Also, do not forget that the Song Length must be represented by another struct called Duration. Duration is defined as follows: Minutes - an integer Seconds - an integer Finally, each struct Node in the doubly linked list must be defined as follows: Data - a Record Pointer to the next node Pointer to the previous node Pointer to the previous node > What must "store" do? The "store" command writes the current records, in the dynamic doubly linked list, to the musicPlayList.csv file. The store will completely overwrite the previous contents in the file. What must "display" do? The "display" command prints records to the screen. This command must support two methods, one of which is selected by the user: 1. Print all records. 2. Print all records that match an artist. > What must "edit" do? The "edit" command must allow the user to find a record in the list by artist. If there are multiple records with the same artist, then your program must prompt the user which one to edit. The user may modify all of the attributes in the record. > What must "rate" do? The "rate" command must allow the user to assign a value of 1 - 5 to a song; 1 is the lowest rating and 5 is the highest rating. The rating will replace the previous rating. > What must "play" do? The "play" command must allow the user to select a song, and must start "playing" each song in order from the current song. "Playing" the song for this assignment means displaying the contents of the record that represents the song for a short period of time, clearing the screen and showing the next record in the list, etc. This continues until all songs have been played. > What must "exit" do? The "exit" command saves the most recent list to the musicPlayList.csv file. This command will completely overwrite the previous contents in the file. IV. Logical Block Diagram The logical block diagram for your doubly linked list should look like the following: Record 1: Artist Album title Song title Genre Song length Times played Rating Record 2: Artist Album title Song title Genre Song length Times played Rating Record n-1: Artist Album title Song title Genre Song length Times played Rating Record n: Artist Album title Song title Genre Song length Times played Rating As you can see from the illustration a doubly linked list has a pointer to the next node and the previous node in the list. The first node's previous node pointer is always NULL and the last node's next pointer is always NULL. When you insert and delete nodes from a doubly linked list, you must always carefully link the previous and next pointers. V. Submitting Assignments: 1. Using Blackboard Learn https://learn.wsu.edu/webapps/login/ submit your assignment. You will submit your assignment in the lab Blackboard space. Under the "Content" link navigate to the "Programming Assignment Submissions" folder and upload your solution to the appropriate "Assignment space. You must upload your solution, through an attachment, as _pa2.zip by the due date and time. 2. Your project must contain at least one header file (a .h file), two C source files (which must be .c files), and a local copy of the .csv file. 3. Your project must build properly. The most points an assignment can receive if it does not build properly is 65 out of 100. |"Swift, Taylor", 1989, Shake it off, Pop, 3:35,12,3 Drake, NOTHING WAS THE SAME, Own it, Rap, 3:23,3,3 Drake, YOU WELCOME, The Motto, Rap, 4:13,7,4 "Perri, Christina", HEAD OF HEART, Trust, Pop, 2:35,3,5 "Bieber, Justin", PURPOSE, No Sense, Pop, 4:12,6,1 Eminem, SHADYXV, Vegas, Rap, 3:37,8,3 Adele, 25, Remedy, Pop, 4:11, 24,4 "Swift, Taylor", RED, Stay Stay Stay,Pop, 4:42,5,1 "Brooks, Garth", FRESH HORSES, The Old Stuff, Country,2:57,11,2 typedef struct duration { int minutes; int seconds; } Duration; typedef struct data { char artist [20]; char album[20]; char song [20]; char genre[20]; Duration songLength; int timesPlayed; int rating; } Data; typedef struct node { struct node* prev; Data record; struct node* next; } Node