This application must be able to handle creating new entries in a proprietary database as well as returning searches for items in the current database. You MUST implement the following: Start the program by displaying the title of your program (you come up with a name) Have a primary prompt that allows you to enter commands             (e.g. “Enter command >” ) Interpret primary commands and move to secondary states based on the commands entered. Commands you must support at the primary prompt are:             a.) new entry             b.) search by actor             c.) search by year             d.) search by runtime (in minutes)             e.) search by director             f.) search by title             g.) quit Your secondary states must do the following:             For “new entry” → Prompts to do the following:                              Enter title >                         Enter year >                         Enter runtime (minutes) >                         Enter actor 1 >                         Enter actor 2 >                         Enter Director >             You must add this entry into the database in one-line (use delimiters between tokens; come up with your own strategy for token order but BE CONSISTENT!)   After entry, return to the main command state...             For “search by actor” → Prompts to:                         Enter actor >             Once actor is entered, search database (hopefully already in memory.) Display a list of movie titles that the actor has been in. This must display the titles of movies actor has been in regardless of if actor was actor 1 or actor 2. (If nothing found, display “No titles found for actor” and return to main prompt.) After entry, return to the main command state...             For “search by year” → Prompt to:                         Enter year >             Once year is entered, search database and return list of titles made in that year. (If nothing found, display “No titles found for year” and return to main prompt.) After entry, return to the main command state...             For “search by runtime” → Prompts to:                         Enter runtime (minutes) >             Search like how you did for year. Display list and return to main prompt. If nothing found, display a prompt saying so and return to main prompt.             For “search by director” → Prompts to:                         Enter director > After entry, return to the main command state...             For “search by title” → Prompts to:                         Enter title >             If the title is found, return the following about title:                         Actors: actor1, actor 2                         Director: director name                         Year: year made                         Runtime: x minutes             if title not found, post message saying so and return to main prompt. After entry, return to the main command state.             For “quit” → This simply exits the program (close out any open I / O streams prior to exit!) Other Requirements: File I/O class (for saving / loading the database) You can make these two classes; one for read / one for write if you want. Keyboard input class (handles declaring Scanner object, retrieving text input, closing object) Class representing a single entry. Use this to easily pass entry information around as a parameter. This class must contain private fields for: title, actor1, actor2, year, runtime, director Also, use get methods (public) to retrieve data from fields Have a class that extends the functionality of the single-entry class and holds the whole current database as a class object. (Hint: You can use an ArrayList behind-the-scenes to do this.) Create get method that can lookup single entry based on certain criteria (index number, search by criteria, etc.) You can overload your get method if you wis

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%

Make a Movie Database program

Project Specifications

Background

This application must be able to handle creating new entries in a proprietary database as well as returning searches for items in the current database.

You MUST implement the following:

  1. Start the program by displaying the title of your program (you come up with a name)
  2. Have a primary prompt that allows you to enter commands

            (e.g. “Enter command >” )

  1. Interpret primary commands and move to secondary states based on the commands entered. Commands you must support at the primary prompt are:

            a.) new entry

            b.) search by actor

            c.) search by year

            d.) search by runtime (in minutes)

            e.) search by director

            f.) search by title

            g.) quit

  1. Your secondary states must do the following:

            For “new entry” → Prompts to do the following:     

                        Enter title >

                        Enter year >

                        Enter runtime (minutes) >

                        Enter actor 1 >

                        Enter actor 2 >

                        Enter Director >

            You must add this entry into the database in one-line (use delimiters between tokens; come up with your own strategy for token order but BE CONSISTENT!)  

  • After entry, return to the main command state...

            For “search by actor” → Prompts to:

                        Enter actor >

            Once actor is entered, search database (hopefully already in memory.) Display a list of movie titles that the actor has been in. This must display the titles of movies actor has been in regardless of if actor was actor 1 or actor 2. (If nothing found, display “No titles found for actor” and return to main prompt.)

  • After entry, return to the main command state...

            For “search by year” → Prompt to:

                        Enter year >

            Once year is entered, search database and return list of titles made in that year. (If nothing found, display “No titles found for year” and return to main prompt.)

  • After entry, return to the main command state...

            For “search by runtime” → Prompts to:

                        Enter runtime (minutes) >

            Search like how you did for year. Display list and return to main prompt. If nothing found, display a prompt saying so and return to main prompt.

            For “search by director” → Prompts to:

                        Enter director >

  • After entry, return to the main command state...

            For “search by title” → Prompts to:

                        Enter title >

            If the title is found, return the following about title:

                        Actors: actor1, actor 2

                        Director: director name

                        Year: year made

                        Runtime: x minutes

            if title not found, post message saying so and return to main prompt.

  • After entry, return to the main command state.

            For “quit” → This simply exits the program (close out any open I / O streams prior to exit!)

Other Requirements:

  • File I/O class (for saving / loading the database) You can make these two classes; one for read / one for write if you want.
  • Keyboard input class (handles declaring Scanner object, retrieving text input, closing object)
  • Class representing a single entry. Use this to easily pass entry information around as a parameter. This class must contain private fields for:
    • title, actor1, actor2, year, runtime, director
    • Also, use get methods (public) to retrieve data from fields
  • Have a class that extends the functionality of the single-entry class and holds the whole current database as a class object. (Hint: You can use an ArrayList behind-the-scenes to do this.)
    • Create get method that can lookup single entry based on certain criteria (index number, search by criteria, etc.) You can overload your get method if you wish.

Classes to use in images.

package Main;
import java util.Arravlist;
public class fileWrite{
// Fields
private Attavlist<String> writeBuffer:
private String filename;
// Constructor
public fileWrite(String filename){
this.tilename = filename;
writeBuffer = new Arcavlist<2();
// Save filename for later
%3D
//Methods
public void writeline(String newline){
// TODO: Add the newline to the writeButfer.
}
public void sayefile){
// TODO: Save all of the lines in the writeBuffer to the file (given in filename)
}
package Main;
import java.util.Arravlist;
public class fileRead {
// Fields
private Arcavlist<String> lines;
// Constructor
public fileßead(String filename}{
lines = new Arravlist<>();
//TODO: Open the filename, read in the data into the lines atravlist, and close
the file when done...
}
// Methods
public int getNumberOfLines(){
// TODO
}
public String getlinelint index){
// TODO
}
}
package Main;
public class Movie {
// Fields
private String title:
private String actor1;
private String actor2;
private String director;
private int year;
private int ryntimeMinutes:
// Constructor
public Movie(String title, String actor1, String actor2, String director, int year, int
tuntimeMinutes){
// TODO
}
// Methods
public String getTitlel){
// TODO
}
public String getActor1(
// TODO
}
public String getActor2{
// TODO
}
public String getQirector){
// TODO
}
public int getYeard){
// TODO
}
public int getRuntimel{
// TODO
}
package Main;
import java.util.Scanner;
public class keyboardinput {
// Fields
private Scanner keyb;
// Constructor
public keyboardlnput(){
keyb = new Scanner(System.in);
}
// Methods
public String getKeyboardLine(){
// TODO: Use the scanner object
}
/* Call this method before you exit the program! Do NOT close the scanner object inside
of getKeyboardLine method! */
public void closeKeyboard(){
keyb.close();
}
}
Transcribed Image Text:package Main; import java util.Arravlist; public class fileWrite{ // Fields private Attavlist<String> writeBuffer: private String filename; // Constructor public fileWrite(String filename){ this.tilename = filename; writeBuffer = new Arcavlist<2(); // Save filename for later %3D //Methods public void writeline(String newline){ // TODO: Add the newline to the writeButfer. } public void sayefile){ // TODO: Save all of the lines in the writeBuffer to the file (given in filename) } package Main; import java.util.Arravlist; public class fileRead { // Fields private Arcavlist<String> lines; // Constructor public fileßead(String filename}{ lines = new Arravlist<>(); //TODO: Open the filename, read in the data into the lines atravlist, and close the file when done... } // Methods public int getNumberOfLines(){ // TODO } public String getlinelint index){ // TODO } } package Main; public class Movie { // Fields private String title: private String actor1; private String actor2; private String director; private int year; private int ryntimeMinutes: // Constructor public Movie(String title, String actor1, String actor2, String director, int year, int tuntimeMinutes){ // TODO } // Methods public String getTitlel){ // TODO } public String getActor1( // TODO } public String getActor2{ // TODO } public String getQirector){ // TODO } public int getYeard){ // TODO } public int getRuntimel{ // TODO } package Main; import java.util.Scanner; public class keyboardinput { // Fields private Scanner keyb; // Constructor public keyboardlnput(){ keyb = new Scanner(System.in); } // Methods public String getKeyboardLine(){ // TODO: Use the scanner object } /* Call this method before you exit the program! Do NOT close the scanner object inside of getKeyboardLine method! */ public void closeKeyboard(){ keyb.close(); } }
package Main;
import java.util.ArraxList;
public class Database {
// Fields
private Arravlist<Movie> movies:
// Constructor
public Database(String filename}{
movies = new Arravlist-2);
fileRead tr = new fileRead(filename):
for(int į = 0; į< ft.getNumberQflines(); ++)X
String raw = fgetlineli):
// TODO: Parse using the StringTokenizer here and place into movies as
%3D
single entries.
}
// Methods
public void addEntoy[Movie newEntov{
I/ TODO
public void sgarchByTitle(String title){
// TODO
public void sgarchByActer(String actor{
// TODO
public void searchByRirector(String director}{
I/ TODO
public void sgarchByYearlint year){
I| TODO
public void searchByBuntimelint runtime{
// TODO
Transcribed Image Text:package Main; import java.util.ArraxList; public class Database { // Fields private Arravlist<Movie> movies: // Constructor public Database(String filename}{ movies = new Arravlist-2); fileRead tr = new fileRead(filename): for(int į = 0; į< ft.getNumberQflines(); ++)X String raw = fgetlineli): // TODO: Parse using the StringTokenizer here and place into movies as %3D single entries. } // Methods public void addEntoy[Movie newEntov{ I/ TODO public void sgarchByTitle(String title){ // TODO public void sgarchByActer(String actor{ // TODO public void searchByRirector(String director}{ I/ TODO public void sgarchByYearlint year){ I| TODO public void searchByBuntimelint runtime{ // TODO
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Knowledge Booster
JQuery and Javascript
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education