[Solved] SOLVED:A program that allows a person to manage their movie collection -SOLUTION

$25

File Name: SOLVED:A_program_that_allows_a_person_to_manage_their_movie_collection_-SOLUTION.zip
File Size: 753.6 KB

SKU: [Solved] SOLVED:A program that allows a person to manage their movie collection -SOLUTION Category: Tag:
5/5 - (1 vote)

New concepts to be applied for this assignment:Dynamic (singly linked) listsFile input and output is not necessary for this assignment. The data for the lists will be manually entered by the user at run time. The program wont save the list contents to file. Description: For this assignment you are to write a program that allows a person to manage their movie collection. The full version will perform some common list management functions such as: adding, displaying, removing or searching. There should not be a limit on the number of movies that can be added.Each movie will be described by four fields:Movie nameThe names of the first three cast membersThe genre of the movieThe number of stars (the rating of the movie)

Description of the fieldsMovie name

This field consists of an alpha (and sometime numeric string e.g., STAR TREK II can also be titled as STAR TREK 2).Cast

The cast list will consist of the full names of three of the actors from this film. A 1D array of strings can be used to store the cast information e.gGenre

The genre field describes the category that the movie falls into. There will be six different categories of movies: action, drama, science fiction, comedy, horror, martial arts or other. You dont have worry about checking for instances where a movie falls into multiple genres.

Rating

This field uses a number of stars to rate each movie according to its entertainment value1. The greater the number of stars, the better the movie:

1 star (It sucks): Its not the type of movie thats so bad that its good, its just all bad. Dont waste your time with this one.

2 stars (Poor): Overall there were more things that I disliked than liked with this movie. Unless theres a ticket sale its probably one that you should avoid.

3 stars (Average): There were some things that I liked and some things that I disliked. Its one that you may want to rent/stream rather than buy.

4 stars (Good): This movie has some flaws but overall youll have a great time watching it.

5 stars (A true masterpiece!): I laughed, I cried, it became a part of me. It should definitely be nominated for an Oscar (maybe several).When movies are displayed each field will reside on a separate line and each movie will be separated by a line of stars (but the stars are not an attribute of a movie object).TERMINATOR 2 JUDGMENT DAYArnold SchwarzeneggerLinda HamiltonEdward FurlongAction5************ITS A WONDERFUL LIFEJames StewartDonna ReedLionel BarrymoreDrama5************ROMEO AND JULIETLeonard WhitingOlivia HusseyJohn McEneryDrama4************<style=line-height: normal=ONCE UPON A TIME A HERO IN CHINACharine ChanTony Leung Kai FaiPeeking Duck aka James TamMartial Arts3************1. JT: The number of stars given to the movies in the example was based solely upon my opinion and does not necessarily reflect the opinions of the university so please dont write angry letters outrage because you thought I didnt properly rate your favourite flick ☺. Classes The basic structure is very similar to the Dice/User interface program to be covered in tutorial:Driver: contains the main method which kicks things off by calling a start method of class UserInterface.UserInterface: handles user input and output, the start method will likely contain the main program loop that only ends when the user quits the program. To actually change or view the list the user interface class will invoke methods of class Manager. These operations must not be directly implemented in the user interface.Manager: handles all list operations such as adding, removing etc.MovieNode: A linked list node whose data attribute is a movie.Movie: Stores data associated with an individual movie (instances contains the 4 attributes associated with a movie such as name, cast etc.)Program featuresDisplays an introduction to the program (describes how it works) each time that its run.

Displays a sign off exit message to indicate to the user that the program has ended.

Defines class Movie with the 4 attributes described above.

Defines class MovieNode (analogous to BookNode from my notes on linked lists) which is a class with two fields: a) Data which is of type Movie b) Next which is a reference to aMovieNode (next node in the list or null for the end of the list).

Defines a Manager class which will include methods for all the major list operations e.g., add, remove, search, display. Your first step is to define this class with empty methods. Later you can fill in the method bodies for the major list operations (feature #11, 14, 15, 16, 17) and the helper methods for feature #10 (helper methods are features #12, 13).

Declares a head reference/pointer of type MovieNode which is initialized to null. The head reference is an attribute of the Manager class.

Defines a UserInterface class which is responsible for all interactions with the user (displaying program options, getting user input). This class does not implement the same operations as the manager class! The user interface class is responsible for displaying a menu of features available (#8 below), getting the users selection, checking the validity of the input and determining the option selected. This class should not include the actual code for changing/displaying the list itself. Once the appropriate menu option has been determined (e.g., a) then the user interface class will tell class manager to run the appropriate method (e.g., addNode()). In tutorial the TAs covered an example program that approximately mimics how the UserInterface class and the Managerclass interact. In that example the GameInterface class will be analogous to the UserInterface class and the Dice class will be roughly analogous to the Manager class. To get credit for the UserInterface class definition (feature #7) you simply have to outline the empty methods and attributes. Credit for implementing those methods are part of feature #8, 9 and several methods associated with #10.

(Class UserInterface method): Displays a menu listing the features available. (The menu options dont have to be functional yet, to get credit for this the feature the menu just has to be displayed).

(Class UserInterface method): The program repeats until the user quits. Each time that the program repeats the main menu (above) is displayed. The (Q)uit menu option has been implemented.

(Other methods of class UserInterface): Checks that the users menu selection was valid and if so it determines what option was selected (likely through branching).

(Class Manager method) (A)dd a movie to the collection: You are to implement one of two versions. (You only get credit for one version or the other). In both cases the program will prompt the user to enter each field one-at-a-time. Although the program doesnt have to check for duplicate movies it should error check the genre and the rating when new movies are added. (See the next two features). The add feature must be implemented before you can get credit for any of the other features that follow it.

The simple version will insert new movies at the end of the list.

The advanced version will insert movies in ascending order of name (in-order insertion). You can use the String method compareToIgnoreCase() (i.e., case insensitive) to determine ordering. Note: an in-order insertion is NOT the same as sorting the list! For this feature you need to find the insertion point and then add the node at that point and NOT change ordering of the other elements.

(Class Manager method to be executed when the add feature is invoked): The genre should only be one of the types listed above. If not the program should continue prompting the user for a value until either a valid genre is entered, or the person signals that they wish to cancel adding a new movie (by just hitting enter blank genre during the error handling loop).

(Class Manager method to be executed when the add feature is invoked): The program should check that the rating is a value between one and five. If not then the program should continue prompting the person for the number of stars until either a legitimate value is entered or the person enters a negative value (to signify that they wish to cancel this option).

(Class Manager method) (D)isplay implemented: Each movie will be separated onscreen by a line of stars. When the list of movies is long, to prevent the output from scrolling off the screen your program should pause the display of movies every 4th movie while it waits for the user to Hit enter to continue. The output must be displayed in a neat and legible format. (See the above example). The program should display an appropriate status message if the list is empty (e.g., List is empty: nothing to display). (JTs hint: you should implement this feature soon after you complete the add feature because its essential for testing the other features).

(Class Manager method) (S)earch: The user types in the name of the movie (case insensitive) to see full information about that movie. If the list is empty then the program should inform the user of this fact and no search should be performed. If the movie is not in the list, then your program should indicate that the movie could not be found under that name. If the movie is in the list, then your program will display additional details about that movie (all the fields of that movie will be displayed onscreen).

(Class Manager method) (R)emove a movie from the list: You can implement one of two versions of this feature (you only get credit for one). In both cases the program should produce some sort of error message if the list is already empty when this feature is invoked.

The simple version will just remove the last node from the list.

The advanced version will prompt the user for the name of the movie to remove. The program will then search for and remove the first instance of that movie (case insensitive search). Similar to the search, an appropriate status message should be displayed if no matches were found.

(Class Manager method) (O)pposite order display: Invoking this method will recursively display the list in reverse order (last movie display first, second last movie displayed secondthe first movie is displayed last). This method should only display the list in reverse order but it should NOT change the actual order of the nodes in the list (i.e., after calling this method the movie that was first in the list should still be first in the list etc.) (JTs hint: some of you may find that this last feature is significantly harder than the other features so you might want to work on this one last.) An appropriate status message should be displayed if the list is empty.

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] SOLVED:A program that allows a person to manage their movie collection -SOLUTION
$25