-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Welcome to the Simple-Movie-Database wiki!
Hi! I made this for fulfill my Java assignment, made it on BlueJ, here's the assignment requirements:
For this assignment, you are required to write a program that implements a simple Movie Database System. This section specifies the required functionality of the program.
The aim of the Movie Database System is for a user to keep a database of the movies he owns in his home movie collection, and to perform operations such as searching for movies, adding/deleting movies, displaying the details of movies, etc.
Even though this program is functionally very different from the program you wrote in Assignment 1, you should be able to re-use much of your previous code here - if you have designed the classes/logic in your previous program properly. This is one of the major benefits of an object-oriented program - the ability to re-use classes.
The Movie Database System should provide the following features :
maintains a list (using a Java Collection class) of Movie objects
o each Movie object represents a single “movie”
o movies can be added/deleted (or for the HD level, edited) from the list
lists the details of an existing movie (or movies)
produces a report of movies based on some criteria
loads a list of movies from a text file
saves the list of current movies to a text file
You are to demonstrate the following programming techniques in your program :
reading/writing data from/to text files
using appropriate Java Collection class or classes to store data
using code to manipulate the data in the collection(s)
performing simple searches, filtered by some given criteria
using program constructs such as repetitions & selections
using appropriate classes to represent objects in the program
When the Movie Database System starts, it should automatically load a text file called "myvideos.txt" which contains details of all movies currently owned by the user. The actual format of this text file is described later in this document. The data loaded should be stored in some appropriate data structures.** No** other reading from or writing to file is required while the program is in operation, until the user chooses to exit, at which point the program saves all the data in memory back to the same text file (myvideos.txt).
In other words, the file I/O operations are performed automatically by the program, and require no direct interactions with the user.
When the program is running, it should repeatedly display a menu with these options :
(1) Search Movies
(2) Add Movie
(3) Delete Movie
(4) Display Favourite Movies
(5) Exit System
Option (1) allows the user to search for a movie in the database. The user should be asked what movie title he wishes to search for (the user can enter partial movie titles). A list of all matching movies (if any) should then be displayed. Each movie should be displayed with its title, director, main actors, and rating.
Option (2) allows the user to add a new movie to the database.
Option (3) allows the user to delete an existing movie from the database. The user should be asked to search the movie by Title. Exact title is to be entered.
Option (4) allows the user to display a list of movies according to ratings. The user should be asked for a number (1-10) representing a rating (higher number indicating better rating), and a list of movies having that rating or higher should be displayed.
Option (5) exits the program. All the movies currently in memory are automatically saved back to "myvideos.txt".
Inputs other than 1-5 should be rejected, and an error message printed. The menu should be displayed repeatedly, until the user chooses Option (5).
You should observe the following assumptions when implementing your program :
all movie titles are unique - if a movie is already in the database, trying to add the same title again should generate an error
there is no limit to how many movies can be stored
each movie has exactly one director
each movie has up to 3 main actors
the same director can direct more than one movie
when performing searches, the search strings are not case-sensitive (eg. "James Cameron" is the same as "James CAMERON")
the data file is always in the correct format - ie. no need to validate the data when reading it in
Each movie in the database contains the following information :
Title (non-blank string)
Director (non-blank string)
a list of up to 3 Main Actors (non-blank strings, except if there are less than 3 main actors)
Rating (integer between 1-10, higher rating indicates better movie)
The input data file (myvideos.txt) has the following format for each line :
Title,Director,Actor1,Actor2,Actor3,Rating
Eg. (the fields are separated by commas - if a movie has less than 3 main actors, the corresponding fields are empty)
Gone With The Wind,Victor Fleming,Clark Gable,Vivien Leigh,Leslie Howard,7
Bad Vampire Movie,Bill Condon,Kristen Stewart,Robert Pattinson,,1
Avatar,James Cameron,Sam Worthington,Zoe Saldana,Someone Else,9
Best Monsters,Nutty Director,ET,King Kong,Godzilla,10