Solved–A Movie Repository II: Movies, Playlists, and Search Trees Lab #6– Solution

$30.00 $19.00

In this assignment, you are going to complete your movie library, using Lab 4 as a starting point. You need to provide a report that shows (20pts): Your class designs The algorithms used This should be in pseudo-code or flowcharts, not just the code you ended up writing Compiling instructions Sample runs (screenshots are fine)…

You’ll get a: . zip file solution

 

 

Description

5/5 – (2 votes)

In this assignment, you are going to complete your movie library, using Lab 4 as a starting point.

You need to provide a report that shows (20pts):

  1. Your class designs

  1. The algorithms used

    1. This should be in pseudo-code or flowcharts, not just the code you ended up writing

  1. Compiling instructions

  2. Sample runs (screenshots are fine)

Things to have (80pts):

Part 1: Binary Search Tree for the Movies (25pts)

  1. A Binary Search Tree that stores all your Movies for the entire library, this is the MovieTree and is the main repository for your movie library

    1. Basically you are replacing the order linked list from Lab 4 with a Binary Search Tree

      1. The Movies remain the same with their internal Review Lists from Lab 4.

      1. Only the MovieList is scrapped in favor of the BST

    1. Movies are sorted by movie title.

    1. No duplicates are allowed.

    1. Remember that the Movies are referenced through pointers in the tree nodes.

    1. Private pointer to the root of the tree and a count of the number of movies in the tree

    1. A constructor and destructor for the BST

    2. The following public methods:

      1. void addMovie(Movie *s);

      2. Movie *findMovie(string title);

      1. int getDepth();

      1. int getNumMovies();

    1. void printTree(bool ascending=true);

  1. A function to read the movies from a file and load them into the MovieTree

Figure 1 BST of Movies

Part 2: RunTime PlayLists of Movies (25pts)

  1. A PlayList for Movies, MoviePlayList

    1. This is a simple linked-list similar to the one you used for the Reviews in Lab 4 except that the Movies in the playlist nodes are pointers to the Movies

      1. You should make the Review and MoviePlay Lists now as a Templates.

    1. Note that the same Movie can exist in different Playlists

    1. Enforce that the same Movie cannot exist in the same Playlist

    1. Not all Movies have to be in a Playlist

    2. Each MoviePlayList also has a title

  1. An algorithm that automatically populates a MoviePlayList with movies based on the Maximum Runtime of the Playlist

    1. The user specifies the total runtime of the PlayList

    1. The system determines the most Movies that can fit into the PlayList from all the available movies.

Part 3: Binary Search Tree for the MoviePlaylists (20pts)

  1. A Binary Search Tree that stores all the Playlists in your repository, this is the

PlaylistTree

    1. The nodes of this tree use pointers to the Playlists to reference them

    1. The tree is sorted by Playlist title

    1. No duplicates are allowed

  1. A function to read the playlists from a file, playlists.txt, create the Playlists and create the PlaylistTree (10pts)

Figure 2 Binary Search Tree of Playlists

Part 4: Menu (10pts)

  1. A menu to allow the user to interact with the system. It should allow (30pts):

    1. Main

      1. Load Movies from file

      1. Load Playlists from file

    1. Songs

      1. List all Movies

      1. Search for Movie by title

    1. Playlists

      1. List all Playlists

      1. Search for Playlist by title

      2. List Movies for Playlist

      1. Create Playlist

      1. Save Playlists

    1. Exit

Extra Credit: (do option 1 OR option 2, no extra will be given for both)

Option1: Implement Polymorphic Trees (10pts)

Instead of creating two different tree class (one with Movie pointers and one with Playlist pointers), create an abstract superclass with Movie and Playlist as subclasses. Create one tree class that uses pointers to this superclass. Implement a polymorphic compare method for the use by the Tree.

Option2: Implement Genres (10pts)

These are similar to Playlists, but hold related Movies based on Genre. You also need to add another Binary Search Tree for Genre, GenreTree.

Update the menu to allow for Listing/Searching Genre, and the RunTime Playlists to allow specification of Genre in addition to total runtime.