Question: Objective: Write A Program That Manages A Movie Database. The User Should Be Able To Add, Remove, And Search The Database. Along With Being Able To Print And Read From A Database File. Requirements: Make A Class GenLinkedList Which Has The Following An Internal Class Of List Nodes That Hold A Generic Type And Link A Head Node For The Start Of The List ...
This problem has been solved!
See the answer
Objective:
Write a program that manages a Movie database. The user should be able to add, remove, and search the database. Along with being able to print and read from a database file.
Requirements:
Make a class GenLinkedList which has the following
An internal class of list nodes that hold a generic type and link
A head node for the start of the list
A current which iterates through the list
A previous node which is always one behind the current.
Functionality that
Adds a new item of a generic type
Removes an item from the list
Returns the value of where the current iterator is located
Move the current iterator forward
Move the current iterator backwards
Move the iterator to the head node
Prints the list
Make a class Movie with the follow
Attributes
Name
Year
Rating (1 to 5 stars)
Director
Box Office Gross
Methods
equals: Takes in another instance of a movie and compares all of the attributes. If they are all equal return true, and otherwise return false.
compareTo: which also takes in another instance of a movie and returns a 0 if its empty or anything else if its not.
toString: Returns a string with all of the attributes
Make a class MovieDatabase which will have a generic linked list of Movies and the following functionality
Add a movie
Remove a movie by title
Search movie by
Title
Director
Year
Rating
(Note that all of these should return an instance or instances of each that correspond. If it is instances you may want to return either an array or a generic linked list of the items.)
Print out all the movies to the console
Print to a database file (you may define your own protocol but tab delimited is recommended)
Read from a database file
Write another class MovieDatabaseFrontEnd which is front end that will allow a user to use any of the features noted in the database description. For instance it may look like:
Enter 1: To Add a Movie
Enter 2: To Remove a Movie by its Title
Enter 3: To search for a Title
Enter 4: To search for moves by a Director
Enter 5: To search for movies of a given Year
Enter 6: To search for movies of a certain Rating
Enter 7: To print out all movies
Enter 8: To print to a database file
Enter 9: To load a database file
Enter 0: To quit
Other notes
You MAY NOT use any built-in java linked structures, such as LinkedList, ArrayList, etc. The point of this is to implement these structures and use them.
Make sure to follow the objectives listed!
Expert Answer
Explanation: