Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Many of us have utilized some type of video application (YouTube). It would be nice to have a program that would manipulate your video collection

Many of us have utilized some type of video application (YouTube). It would be nice to have a program that would manipulate your video collection based on attributes such as Film Title, Running Time, Genre, Description, Year, Director. For this assignment you will write a basic video playlist manager.

Your 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. you will need to complete the main menu.

o 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.

o What must load do? The load command must read all records from a file called moviePlayList.csv attached to the assignment on blackboard 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: o Film Title a string o Director a string o Description a string o Genre a string o Running Time - a struct Duration type consisting of hours and minutes, both integers o Year an integer o Number times played an integer o 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 Movie Length must be represented by another struct called Duration. Duration is defined as follows: o Hours an integer o Minutes an integer

Finally, each struct Node in the doubly linked list must be defined as follows: o Data a Record o Pointer to the next node o Pointer to the previous node

o What must store do? The store command writes the current records, in the dynamic doubly linked list, to the moviePlayList.csv file. The store will completely overwrite the previous contents in the file.

o What must edit do? The edit command must allow the user to find a record in the list by director. If there are multiple records with the same director, then your program must prompt the user which one to edit. The user may modify all of the attributes in the record.

o What must rate do? The rate command must allow the user to assign a value of 1 5 to a movie; 1 is the lowest rating and 5 is the highest rating. The rating will replace the previous rating.

o What must play do? The play command must allow the user to select a movie and must start playing each movie in order from the current movie. Playing the movie for this assignment means displaying the contents of the record that represents the movie for a short period of time, clearing the screen and showing the next record in the list, etc. This continues until all movies have been played.

o What must exit do? The exit command saves the most recent list to the moviePlayList.csv file. This command will completely overwrite the previous contents in the file.

You will also be required to write 3 test functions.

a. What must insert do? The insert command must prompt the user for the details of a new movie record. The prompt must request the movie title, director, description, genre, running time, year, number of times played, and rating. The new record must be inserted at the front of the list.

b. What must delete do? The delete command must prompt the user for a movie title and remove the matching record from the list. If the movie title does not exist, then the list remains unchanged.

c. What must shuffle do? The shuffle command must provide a random order in which the movies are played. This command must not modify the links in the list. It must just specify the order in which movies are played, based on the position of the movie in the list. For example, lets say we have a list with 5 movies at positions 1 5 in the list, shuffle must generate an order 1 5 in which the movies are played. An order 2, 5, 3, 1, 4 would require that the second movie in the list is played first, the fifth movie in the list is played second, the third movie in the list is played third, the first movie in the list is played fourth, and the fourth movie in the list is played fifth. The movies are accessed by traversing the list both forwards and backwards to satisfy the order. Hence, the need for a doubly linked list!

d. What must sort do? The sort command must prompt the user for 4 different methods to sort the records in the list. These include: 1. Sort based on director (A-Z) 2. Sort based on file name(A-Z) 3. Sort based on rating (1-5) 4. Sort based on times played (largest-smallest) Once a sort method is selected by the user, the sort must be performed on the records in the list. Consider using bubble sort, insertion sort, or selection sort.

What test functions are required?

You must design and implement 3 test functions. These test functions must not accept any arguments or return any values. They should be self-sufficient. You should provide function declarations for them that are in a separate header file than your utility/application function declarations. You must implement one test function for insert, delete, and shuffle features for a total of 3 functions.

o For the insert test function you must provide a test case with the following test point: movie title = Bohemian Rhapsody, director = Bryan Singer, description= Freddie Mercury the lead singer of Queen defies stereotypes and convention to become one of history's most beloved entertainers., genre = Drama, running time = 2:13, year = 2018, times played = -1, rating = 6. You must think about what is your expected result? Should you able to insert a movie with -1 times played? Should you able to add a movie with rating 6? Is the head pointer of the list updated?

o For the delete test function you must provide a test case with the following test point: movie title = Bohemian Rhapsody, director = Bryan Singer, description= Freddie Mercury the lead singer of Queen defies stereotypes and convention to become one of history's most beloved entertainers., genre = Drama, running time = 2:13, year = 2018, times played = -1, rating = 6. You must think about what is your expected result? Has the head pointer been updated? Is it NULL? Did the memory get released?

o For the shuffle test function you must provide a test case with the following test point: list the play order that was randomly generated and list the movies. Example: play order = 3, 1, 2. List state = you provide 3 movies. Does the shuffle play in the correct order?

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.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

can someone explain this? PV = nyingit a pn +-+ (cpn + par) (1+r)

Answered: 1 week ago