Project 2
Due Wednesday, Mar. 8 11:55pm.
Submission through SVN.
Please submit your work in SVN directory
https://www.cs.usfca.edu/svn/< your username >/cs112/proj2
e.g. https://www.cs.usfca.edu/svn/ejung/cs112/proj2
Learning outcome
You will be able to design a class (Movie) and use it in a different class (Driver). You will also get more familiar with reading files in Scanner and working with arrays of objects.
Specifications
- Movie class has 4 instance variables, including title (String type), year (int type), genre (String type), and one of your own design.
- All instance variables are initialized in a constructor.
- All instance variables are private.
- Movie class has 4 getter methods, one for each instance variable, for other classes to read the values.
- Create a text file that contains information for 10 Movie objects. movies_lab2.txt contains an example of information to create 1 Movie object with director's name.
- Driver class reads the information from the text file, and creates an array of 10 Movie objects.
- Driver class uses the getter methods in Movie class to enable search by title (code from project 1) and display the content of all 4 instance variables.
Example Runs
Example Run 1
--------------
Welcome to USFlix!
Enter keywords: monster
Monsters University (2013)
Genre: Animation
Director: Dan Scanlon
Example Run 2
--------------
Welcome to USFlix!
Enter keywords: university
Monsters University (2013)
Genre: Animation
Director: Dan Scanlon
Example Run 3
--------------
Welcome to USFlix!
Enter keywords: ball
No results found
Submission
Submit Movie.java, Driver.java, the text file that you've created for the movie data, and README. In the README, explain how your program works. In particular, explain how you integrated and changed the code from project 1.