Overview:

In this homework, you will apply many of the concepts covered so far during the semester, including control structures (sequence, selection and repetition), functions, pointers, dynamic memory management, and linear data structures. After completion, you should feel comfortable with allocating memory on the heap to create more complex data structures. Specifically, you will learn how to link different objects in the heap together, to (bi-directionally) traverse through these objects in memory, and to de-allocate all memory previously allocated in the heap.

Objectives:

  • To use the dynamic list data structure to support users needs during run-time.
  • To store, sort and search lists and tables of values.
  • To understand the similarities and differences between pointers and references, and when to use each.
  • To use pointers to pass arguments to functions by reference.
  • To understand how to manage memory in the heap.
  • Basic searching and sorting techniques.
  • To use C++11 capabilities, including nullptr

In this homework, you will create a basic version of the Netflix Movie Queue. The Queue will be implemented as a bi-directional dynamic linked-list (in the Heap). That is, each node in the list must contain links or pointers to the nodes immediately adjacent to it in the list data structure (e.g., pPreviousNode and pNextNode). Your Netflix software shall meet the following requirements:

  • The software shall provide a main menu with options to accomplish the following:
    • Displaying Movies in the Queue
    • Adding Movies to the Queue
    • Editing Movies in Queue
    • Removing Movie from Queue
    • Searching for Movie in Queue
  • Upon selection in main menu, the software shall execute code to support the actions specified in (1).
  • The main menu shall execute until the user quits the program.
  • Upon exiting the program, the software shall de-allocate or destroy all memory used by the Queue.
  • The software shall keep track of the following movie information.
    • Movie name
    • Rating
    • Rating
    • Year
  • The software ranking shall be accepted as a numeric input, from 1-5; 1 for lowest and 5 for highest.
  • The software ranking shall be displayed as output as a series of asterisk characters* reflecting the ranking number entered by the user.
  • The software shall detect duplicate movies by name and year.
  • The software shall allow the option to display the contents of the queue by highest to lowest ranking.
  • The software shall allow the option to display the contents of the queue by lowest to highest ranking.
  • The software shall allow the option to filter the display of movies in the queue by Rating.
  • The software shall sort movies in alphabetical order using insertion sort.
  • The software shall verify all inputs to prevent it from crashing.
  • The software shall match the sample execution below. See image.
Welcome to the Netflix Movie Menu!

1. Display Movie Queue
2. Add Movie to Queue
3. Edit Movie in Queue
4. Remove Movie from Queue
5. Search for Movie in Queue
6. Exit Program

Enter option: 1
The movie queue is empty! Please add movies to the queue.

1. Display Movie Queue
2. Add Movie to Queue
3. Edit Movie in Queue
4. Remove Movie from Queue
5. Search for Movie in Queue
6. Exit Program

Enter option: 2
Enter Movie Name: The Wizard of Oz
Enter Year: 1939 Rating:
PG Ranking (1-5): 4
Movie added to the Queue!

1. Display Movie Queue
2. Add Movie to Queue
3. Edit Movie in Queue
4. Remove Movie from Queue
5. Search for Movie in Queue
6. Exit Program

Enter option: 2
Enter Movie Name: Stand by Me
Enter Year: 1986
Rating: R
Ranking (1-5): 5
Movie added to the Queue!

1. Display Movie Queue
2. Add Movie to Queue
3. Edit Movie in Queue
4. Remove Movie from Queue
5. Search for Movie in Queue
6. Exit Program

Enter option: 2
Enter Movie Name: The Croods
Enter Year: 2013
Rating: PG Ranking (1-5): 3
Movie added to the Queue!

1. Display Movie Queue
2. Add Movie to Queue
3. Edit Movie in Queue
4. Remove Movie from Queue
5. Search for Movie in Queue
6. Exit Program

Enter option: 1
Display options:
1. Highest to Lowest Ranking
2. Lowest to Highest Ranking
3. Filter by Rating
4. Sorted movie queue
5. Exit Display Menu

Enter option: 3
Enter Rating: PG

The movies in your Queue with Rating PG are displayed below. ----------------------------
The Wizard of Oz
Year: 1939
Rated: PG
Ranked: ****
----------------------------
The Croods
Year: 2013
Rated: PG
Ranked: ***
----------------------------

Display options:
1. Highest to Lowest Ranking
2. Lowest to Highest Ranking
3. Filter by Rating
4. Sorted movie queue
5. Exit Display Menu

Enter option: 1
The movies in your Queue are displayed below.
----------------------------
Stand by Me
Year: 1986
Rated: R
Ranked: *****
----------------------------
The Wizard of Oz
Year: 1939
Rated: PG
Ranked: ****
----------------------------
The Croods
Year: 2013
Rated: PG
Ranked: ***
----------------------------

Display options:
1. Highest to Lowest Ranking
2. Lowest to Highest Ranking
3. Filter by Rating
4. Sorted movie queue
5. Exit Display Menu

Enter option: 5
Exiting Display Menu.

1. Display Movie Queue
2. Add Movie to Queue
3. Edit Movie in Queue
4. Remove Movie from Queue
5. Search for Movie in Queue
6. Exit Program

Enter option: 4
Enter Movie Name: The Croods
Enter Year: 2013
The Croods has been removed from your queue!

1. Display Movie Queue
2. Add Movie to Queue
3. Edit Movie in Queue
4. Remove Movie from Queue
5. Search for Movie in Queue
6. Exit Program

Enter option: 1
Display options:
1. Highest to Lowest Ranking
2. Lowest to Highest Ranking
3. Filter by Rating
4. Sorted movie queue
5. Exit Display Menu

Enter option: 1
The movies in your Queue are displayed below.
----------------------------
Stand by Me
Year: 1986
Rated: R
Ranked: *****
----------------------------
The Wizard of Oz
Year: 1939
Rated: PG
Ranked: ****
----------------------------

Display options:
1. Highest to Lowest Ranking
2. Lowest to Highest Ranking
3. Filter by Rating
4. Sorted movie queue
5. Exit Display Menu

Enter option: 5
Exiting Display Menu.

1. Display Movie Queue
2. Add Movie to Queue
3. Edit Movie in Queue
4. Remove Movie from Queue
5. Search for Movie in Queue
6. Exit Program

Enter option: 6
Exit Program. Good Bye!
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.