Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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 classGenLinkedListwhich 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 classMoviewith 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 classMovieDatabasewhich 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 classMovieDatabaseFrontEndwhich 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.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Heres a Java implementation fulfilling your requirements import javaio import javautil class Movie implements Comparable private String name private int year private int rating private String director ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started