Lab 7: Hash Tables (100 pts)

Due Monday, November 12 at 11:59pm on Canvas


Pair Programming Extra Credit Opportunity (5 pts)
  • Both partners fill in, sign and date the pair programming contract (both partners submit).
  • Upload the document(s) along with your Lab to Canvas.
  • Only ONE partner submits the lab assignment on Canvas. Please make sure both your names are on ALL THE FILES.

Part 1: Complete the Movie Class (10 pts)

  • Copy and paste the below code into a file named Movie.java.
  • Fill in the missing method bodies to override equals, and hashCode and implement compareTo for a Movie object, as described in the comments for these methods.
  • Note: Please do not alter this file in any way or you may not receive credit for this Lab. You must only add to it.

/**
 * Movie.java
 * @author
 * @author
 * CIS 22C, Lab 7
 */
public class Movie implements Comparable<Movie>{
    private String title;
    private String director;
    private int year;
    private double grossMillions;
   
    /**
     * Constructor for the Movie class
     * @param title the Movie's title
     * @param director the Movie's director
     * @param year the year the Movie was released
     * @param gross the amount grossed
     * over the lifetime of the movie,
     * given in Millions of dollars
     */
    public Movie(String title, String director,
            int year, double gross) {
        this.title = title;
        this.director = director;
        this.year = year;
        this.grossMillions = gross;
    }
   
    /**
     * Accesses the title of the Movie
     * @return the Movie's title
     */
    public String getTitle() {
        return title;
    }
   
    /**
     * Accesses the director of the Movie
     * @return the Movie's director
     */
    public String getDirector() {
        return director;
    }
   
    /**
     * Access the year the Movie was released
     * in theaters
     * @return the year the Movie was released
     */
    public int getYear() {
        return year;
    }
   
    /**
     * Access the gross amount earned by the
     * Movie in Millions of dollars
     * @return the Movie's gross in Millions
     */
    public double getGross() {
        return grossMillions;
    }
   
    /**
     * Sets the title of the Movie
     * @param title the Movie's title
     */
    public void setTitle(String title) {
        this.title = title;
    }
   
    /**
     * Sets the director of the Movie
     * @param director the Movie's director
     */
    public void setDirector(String director) {
        this.director = director;
    }
   
    /**
     * Sets the year the Movie was released
     * @param year the year the Movie was released
     */
    public void setYear(int year) {
        this.year = year;
    }
   
    /**
     * Sets the gross amount earned by the Movie
     * in Millions of dolalrs
     * @param gross the gross amount in Millions
     * of dollars
     */
    public void setGross(double gross) {
        grossMillions = gross;
    }
   
    /**
     * Formats the movie for display, using
     * the following format:
     * Title: <title>
     * Director: <director>
     * Year: <year>
     * Gross in Millions: $<grossMillions>
     * Note that there should be no <>
     * in the resulting String
     */
    @Override public String toString() {
        String result = "Title: " + title
                + "\nDirector: " + director
                + "\nYear: " + year
                + "\nGross in Millions: $" + grossMillions;
        return result;
    }
   
    /**
     * Determines whether two Movie objects are
     * equal by comparing titles and directors
     * @param otherMovie the second Movie object
     * @return whether the Movies are equal
     */
    @Override public boolean equals(Object o) {
        return false;
    }
   
    /**
     * Compares two Movie objects to determine ordering
     * Returns 0 if the two items are equal
     * Return -1 if this Movie's title comes alphabetically
     * before the other Movie's title.
     * Returns 1 if the other Movie's title comes
     * alphabetically before this movie's title
     * If the two movie's titles are the same, will
     * differentiate by director's name (alphabetical
     * comparison)
     * @param the other Movie object to compare to this
     * @return 0 (same movie), -1 (this movie ordered first)
     * or 1 (the other movie ordered first)
     */
    public int compareTo(Movie otherMovie) {
        return -1;
    }
   
    /**
     * Returns a consistent hash code for
     * each Movie by summing the Unicode values
     * of each character in the key
     * Key = title + director
     * @return the hash code
     */
    @Override public int hashCode() {
        return -1;
    }

}


Part 2: Write the Hash.java class (70 pts)
  • Create a new Java project for Lab 7
  • Create a new List.java class inside this folder and copy and paste your List.java from Lab 4 into this folder.
  • You will be using the List class as part of your Hash Table implementation
  • Create a second file called Hash.java and copy and paste the below code into it.
  • Please do not alter Hash.java in any way other than to implement the methods or you may not receive credit for this lab
  • Note that you are storing the values in an ArrayList of Lists.
  • Therefore, each index of the ArrayList is one linked list.
  • For most of these methods, you will be calling List.java methods
    • Try to re-use the methods you have already written for List.java rather than re-writing these methods
    • Remember that you have ways to search, insert at the end of a List, iterate through the nodes in a List, etc.
    • The challenge of this Lab will be to understand which List methods to call and to keep separate in your mind the ArrayList from the Lists stored inside the ArrayList
/**
* Hash.java
* @author
* @author
* CIS 22C, Lab 7
*/
import java.util.ArrayList;

public class Hash<T extends Comparable<T>> {

private int numElements;
private ArrayList<List<T> > Table;

/**
* Constructor for the Hash.java
* class. Initializes the Table to
* be sized according to value passed
* in as a parameter
* Inserts size empty Lists into the
* table. Sets numElements to 0
* @param size the table size
*/
public Hash(int size) {
}

/**Accessors*/

/**
* Returns the hash value in the Table
* for a given key by taking modulus
* of the hashCode value for that key
* and the size of the table
* @param t the key
* @return the index in the Table
*/
private int hash(T t) {
    return -1;
}

/**
* Counts the number of keys at this index
* @param index the index in the Table
* @precondition 0 <= index < Table.length
* @return the count of keys at this index
* @throws IndexOutOfBoundsException
*/
public int countBucket(int index) throws IndexOutOfBoundsException{
    return -1;
}

/**
* Returns total number of keys in the Table
* @return total number of keys
*/
public int getNumElements() {
    return -1;
}

/**
* Searches for a specified key in the Table
* @param t the key to search for
* @return the index in the Table (0 to Table.length - 1)
* or -1 if t is not in the Table
*/
public int search(T t) {
    return -1;
}


/**Manipulation Procedures*/

/**
* Inserts a new key in the Table
* calls the hash method to determine placement
* @param t the key to insert
*/
public void insert(T t) {
}


/**
* removes the key t from the Table
* calls the hash method on the key to
* determine correct placement
* has no effect if t is not in
* the Table
* @param t the key to remove
*/
public void remove(T t) {
}

/**Additional Methods*/

/**
* Prints all the keys at a specified
* bucket in the Table. Each key displayed
* on its own line, with a blank line
* separating each key
* Above the keys, prints the message
* "Printing bucket #<bucket>:"
* Note that there is no <> in the output
* @param bucket the index in the Table
*/
public void printBucket(int bucket) {
}

/**
* Prints the first key at each bucket
* along with a count of the total keys
* with the message "+ <count> -1 more
* at this bucket." Each bucket separated
* with to blank lines. When the bucket is
* empty, prints the message "This bucket
* is empty." followed by two blank lines
*/
public void printTable(){
}
}

  • Next, create a third Java file for this project called HashTest.java
  • Copy and paste the below code into this file.
  • Note that this test file is incomplete. You will need to add more tests to this file in order to test your Hash.java thoroughly
/**
 * HashTest.java
 * @author
 * @author
 * CIS 22C, Lab 7
 */

public class HashTest {
    public static void main(String[] args) {
         Hash<Movie> t = new Hash<Movie>(20);
         Movie bond1 = new Movie("Dr No", "Terence Young", 1962, 59.5);
         Movie bond2 = new Movie("From Russia with Love", "Terence Young", 1963, 79.0);
         Movie bond3 = new Movie("Goldfinger", "Guy Hamilton", 1964, 125.0);
         Movie bond4 = new Movie("Thunderball", "Kevin McClory", 1965, 141.2);
         Movie bond5 = new Movie("Casino Royale", "Ken Hughes", 1967, 41.7);
         Movie bond6 = new Movie("You Only Live Twice", "Lewis Gilbert", 1967, 111.6);
         Movie bond7 = new Movie("On Her Majesty's Secret Service", "Peter R. Hunt", 1969, 82.0);
         Movie bond8 = new Movie("Diamonds are Forever", "Guy Hamilton", 1971, 116.0);
         Movie bond9 = new Movie("Live and Let Die", "Guy Hamilton", 1973, 161.8);
         Movie bond10 = new Movie("The Man with the Golden Gun", "Guy Hamilton", 1974, 97.6);
         t.insert(bond1);
         t.insert(bond2);
         t.insert(bond3);
         t.insert(bond4);
         t.insert(bond5);
         t.insert(bond6);
         t.insert(bond7);
         t.insert(bond8);
         t.insert(bond9);
         t.insert(bond10);
        
         System.out.println("***Testing Insert and PrintTable***\n");
        
         t.printTable();
        
         System.out.println("***Testing PrintBucket***\n");
        
         t.printBucket(19);
        
         System.out.println("***Testing CountBucket***\n");
         int count = t.countBucket(19);
         System.out.println("\nThere are " + count + " movies at bucket 19\n");
        
         System.out.println("***Testing Search***\n");
         int index = t.search(bond9);
         if (index != -1) {
             System.out.println(bond9.getTitle() + " is stored at index " + index);
         } else {
             System.out.println(bond9.getTitle() + " is not stored in the table");
         }
      
         System.out.println("\n***Testing Remove***\n");
         t.remove(bond9);
         System.out.println(bond9.getTitle() + " should be removed from this index: ");
         t.printBucket(19);
        
         index = t.search(bond9);
         if (index != -1) {
             System.out.println(bond9.getTitle() + " is stored at index " + index);
         } else {
             System.out.println(bond9.getTitle() + " is not stored in the table");
         }
    }
}

Output of HashTest.java

***Testing Insert and PrintTable***

Bucket: 0
Title: You Only Live Twice
Director: Lewis Gilbert
Year: 1967
Gross in Millions: $111.6
+ 0 more at this bucket


Bucket: 1
This bucket is empty.


Bucket: 2
This bucket is empty.


Bucket: 3
This bucket is empty.


Bucket: 4
This bucket is empty.


Bucket: 5
Title: On Her Majesty's Secret Service
Director: Peter R. Hunt
Year: 1969
Gross in Millions: $82.0
+ 0 more at this bucket


Bucket: 6
Title: The Man with the Golden Gun
Director: Guy Hamilton
Year: 1974
Gross in Millions: $97.6
+ 0 more at this bucket


Bucket: 7
Title: Casino Royale
Director: Ken Hughes
Year: 1967
Gross in Millions: $41.7
+ 0 more at this bucket


Bucket: 8
This bucket is empty.


Bucket: 9
Title: Diamonds are Forever
Director: Guy Hamilton
Year: 1971
Gross in Millions: $116.0
+ 0 more at this bucket


Bucket: 10
This bucket is empty.


Bucket: 11
This bucket is empty.


Bucket: 12
This bucket is empty.


Bucket: 13
Title: From Russia with Love
Director: Terence Young
Year: 1963
Gross in Millions: $79.0
+ 0 more at this bucket


Bucket: 14
Title: Goldfinger
Director: Guy Hamilton
Year: 1964
Gross in Millions: $125.0
+ 0 more at this bucket


Bucket: 15
Title: Dr No
Director: Terence Young
Year: 1962
Gross in Millions: $59.5
+ 0 more at this bucket


Bucket: 16
This bucket is empty.


Bucket: 17
This bucket is empty.


Bucket: 18
This bucket is empty.


Bucket: 19
Title: Thunderball
Director: Kevin McClory
Year: 1965
Gross in Millions: $141.2
+ 1 more at this bucket


***Testing PrintBucket***

Printing bucket #19:

Title: Thunderball
Director: Kevin McClory
Year: 1965
Gross in Millions: $141.2

Title: Live and Let Die
Director: Guy Hamilton
Year: 1973
Gross in Millions: $161.8



***Testing CountBucket***


There are 2 movies at bucket 19

***Testing Search***

Live and Let Die is stored at index 19

***Testing Remove***

Live and Let Die should be removed from this index:
Printing bucket #19:

Title: Thunderball
Director: Kevin McClory
Year: 1965
Gross in Millions: $141.2



Live and Let Die is not stored in the table




Calling the Hash Method

  • For the purposes of this assignment, we will be using the algorithm defined in class which sums the Unicode values of all the characters in the key and scales the result to indices of the table.
  • This algorithm is divided into two methods - hashCode(), overriden in the Movie.java class, and hash, written in the Hash.java class


Adding Values to the Hash Table

  • The next step in the process is to be able to add a value to the hash table.
  • Since we are using the separate chaining approach to collisions, we are using an ArrayList of Lists to represent our table.
  • Each time we insert a new movie into the table, we need to complete these steps:
  1. Call the hash method to determine at which index or bucket to place the movie inside the table
  2. Insert the Movie at the correct index in the ArrayList
  3. Note that you need to call the correct method from the List class to insert this movie onto the end of the chain of movies.
  4. Each time you insert a new movie, it should be added onto the end of the chain. There is no additional sorting required (or needed).


Printing Using printBucket:

  • To verify your Hash Table functions are working properly, you need to be able to print the values contained in the Table.
  • Therefore, your next step - after writing insert - should be to write a print method.
  • There are two print methods you need to write for this lab; each one is used in a different way.
  • printBucket is used to display all of the values stored at a single bucket (a "row" in the table).
  • In contrast, printTable will display the first value stored at each index or bucket in the table (the "first column" in the table).
  • The printBucket method will allow us to dig more deeply into what is contained at a particular bucket.
  • You can think of printTable as providing a vertical cross section of values in the Table whereas printBucket gives us a horizontal cross section.
  • For example, a call to printBucket(19); in HashTest.java should display the following (assuming you have inserted the values provided above).


Printing bucket #19:

Title: Thunderball
Director: Kevin McClory
Year: 1965
Gross in Millions: $141.2

Title: Live and Let Die
Director: Guy Hamilton
Year: 1973
Gross in Millions: $161.8


Printing the Hash Table Using printTable

  • printTable displays the first value stored at each index in the table.
  • If you are following along with my example for HashTest.java, we want our printTable function to print the following to the console given the values we have already inserted:

Bucket: 0
Title: You Only Live Twice
Director: Lewis Gilbert
Year: 1967
Gross in Millions: $111.6
+ 0 more at this bucket


Bucket: 1
This bucket is empty.


Bucket: 2
This bucket is empty.


Bucket: 3
This bucket is empty.


Bucket: 4
This bucket is empty.


Bucket: 5
Title: On Her Majesty's Secret Service
Director: Peter R. Hunt
Year: 1969
Gross in Millions: $82.0
+ 0 more at this bucket


Bucket: 6
Title: The Man with the Golden Gun
Director: Guy Hamilton
Year: 1974
Gross in Millions: $97.6
+ 0 more at this bucket


Bucket: 7
Title: Casino Royale
Director: Ken Hughes
Year: 1967
Gross in Millions: $41.7
+ 0 more at this bucket


Bucket: 8
This bucket is empty.


Bucket: 9
Title: Diamonds are Forever
Director: Guy Hamilton
Year: 1971
Gross in Millions: $116.0
+ 0 more at this bucket


Bucket: 10
This bucket is empty.


Bucket: 11
This bucket is empty.


Bucket: 12
This bucket is empty.


Bucket: 13
Title: From Russia with Love
Director: Terence Young
Year: 1963
Gross in Millions: $79.0
+ 0 more at this bucket


Bucket: 14
Title: Goldfinger
Director: Guy Hamilton
Year: 1964
Gross in Millions: $125.0
+ 0 more at this bucket


Bucket: 15
Title: Dr No
Director: Terence Young
Year: 1962
Gross in Millions: $59.5
+ 0 more at this bucket


Bucket: 16
This bucket is empty.


Bucket: 17
This bucket is empty.


Bucket: 18
This bucket is empty.


Bucket: 19
Title: Thunderball
Director: Kevin McClory
Year: 1965
Gross in Millions: $141.2
+ 1 more at this bucket


  • In other words, for each bucket in the table, we are going to output the following to the console:
Bucket <index>
Title: <title>
Author: <author>
Year: <year>
Gross in Millions: $<gross>

+<#> more at this bucket

  • Also, please note that there are no <> around the output. The <> are conventionally used to mean fill in the blank. You should get used to this convention as you will likely see it again in computer science.


Counting items at a bucket using the countBucket function

  • For this method, you will need to count the number of movies at a specific index or bucket.
  • Note that this method is a helper to printTable, which provides a tally of how many movies are stored at each index as part of its output (see above).


Searching the Table

  • Our search method will search for a particular movie to determine at which bucket it is stored in the Table.
  • Our first step will be to call the hash method to determine which index the movie would be hashed to.
  • Next, you will need to search through the values at this bucket to determine if the movie is stored at that bucket.
  • If you find the movie, return the bucket or index (important: not the index in the linked list!).
  • If the movie is not in the table, your method should return -1.
  • Note that you can use one of your List methods to complete this search. Which one is a better choice for a linked list search?

Removing a Movie from the Table

  • To remove a movie, you will need to complete these steps:
  1. Pass the movie to the hash method to determine at which index this movie is located (if in the table).
  2. Search for the movie in the chain at that bucket
  3. Once you have located it, call the appropriate List removal method to remove the movie from that bucket .



Part 3: MovieDatabase.java (20 pts)


Text File: movies.txt

  • In Eclipse, right click the name of your project
  • Go to File-> New -> File and name your file movies.txt
  • Note that this file contains information all James Bond movies ever made
  • Copy and paste the below contents into your text file
  • This will be the file you will use to populate your hash table

Dr No
Terence Young
1962
59.5

From Russia with Love
Terence Young
1963
79.0

Goldfinger
Guy Hamilton
1964
125.0
         
Thunderball
Kevin McClory
1965
141.2

Casino Royale
Ken Hughes
1967
41.7

You Only Live Twice
Lewis Gilbert
1967
111.6

On Her Majesty's Secret Service
Peter R. Hunt
1969
82.0

Diamonds are Forever
Guy Hamilton
1971
116.0

Live and Let Die
Guy Hamilton
1973
161.8

The Man with the Golden Gun
Guy Hamilton
1974
97.6

The Spy Who Loved Me
Lewis Gilbert
1977
185.4

Moonraker
Lewis Gilbert
1979
210.3

For Your Eyes Only
John Glen
1981
195.3

Octopussy
John Glen
1983
187.5

Never Say Never Again
Irvin Kirshner
1983
160.0

A View to Kill
John Glen
1985
152.4

The Living Daylights
John Glen
1987
191.2

Licence to Kill
John Glen
1989
156.1

Goldeneye
Martin Campbell
1995
355.0

Tomorrow Never Dies
Roger Spottiswoode
1997
333.0

The World is Not Enough
Michael Apted
1999
362.0

Die Another Day
Lee Tamahori
2002
435.0

Casino Royale
Martin Campbell
2006
600.0

Quantum of Solace
Marc Forster
2008
586.1

Skyfall
Sam Mendes
2012
1109

Spectre
Sam Mendes
2015
880.7


  • Working with the .txt file provided above, write a user interface that works like the given example.
  • This user interface must use a  hash table to store the movie objects from the text file
  • Please read through the sample output carefully to understand all the features of this application, including what error checking is required.

Welcome to the Bond Movie Database!

Please select from one of the following options:

A. Add a Movie
D. Display all Movies
R. Remove a Movie
S. Search for a Movie
X. Exit

Enter your choice: Z

Invalid Selection!

Please select from one of the following options:

A. Add a Movie
D. Display all Movies
R. Remove a Movie
S. Search for a Movie
X. Exit

Enter your choice: A

Adding a movie!

Enter the title: Austin Powers: International Man of Mystery
Enter the director: Jay Roach
Enter the year: 1997
Enter the gross in millions: $67.7

Austin Powers: International Man of Mystery was added!

Please select from one of the following options:

A. Add a Movie
D. Display all Movies
R. Remove a Movie
S. Search for a Movie
X. Exit

Enter your choice: D
Displaying Movie Database:

Printing bucket #0:



Printing bucket #1:

Title: Quantum of Solace
Director: Marc Forster
Year: 2008
Gross in Millions: $586.1



Printing bucket #2:



Printing bucket #3:

Title: From Russia with Love
Director: Terence Young
Year: 1963
Gross in Millions: $79.0

Title: Casino Royale
Director: Ken Hughes
Year: 1967
Gross in Millions: $41.7



Printing bucket #4:

Title: The Man with the Golden Gun
Director: Guy Hamilton
Year: 1974
Gross in Millions: $97.6

Title: Casino Royale
Director: Martin Campbell
Year: 2006
Gross in Millions: $600.0



Printing bucket #5:



Printing bucket #6:

Title: Die Another Day
Director: Lee Tamahori
Year: 2002
Gross in Millions: $435.0



Printing bucket #7:



Printing bucket #8:



Printing bucket #9:

Title: Goldeneye
Director: Martin Campbell
Year: 1995
Gross in Millions: $355.0



Printing bucket #10:

Title: You Only Live Twice
Director: Lewis Gilbert
Year: 1967
Gross in Millions: $111.6



Printing bucket #11:

Title: Dr No
Director: Terence Young
Year: 1962
Gross in Millions: $59.5



Printing bucket #12:

Title: Octopussy
Director: John Glen
Year: 1983
Gross in Millions: $187.5



Printing bucket #13:

Title: Thunderball
Director: Kevin McClory
Year: 1965
Gross in Millions: $141.2

Title: Skyfall
Director: Sam Mendes
Year: 2012
Gross in Millions: $1109.0

Title: Spectre
Director: Sam Mendes
Year: 2015
Gross in Millions: $880.7



Printing bucket #14:

Title: A View to Kill
Director: John Glen
Year: 1985
Gross in Millions: $152.4



Printing bucket #15:

Title: Never Say Never Again
Director: Irvin Kirshner
Year: 1983
Gross in Millions: $160.0

Title: Licence to Kill
Director: John Glen
Year: 1989
Gross in Millions: $156.1

Title: Tomorrow Never Dies
Director: Roger Spottiswoode
Year: 1997
Gross in Millions: $333.0



Printing bucket #16:

Title: Goldfinger
Director: Guy Hamilton
Year: 1964
Gross in Millions: $125.0

Title: The Spy Who Loved Me
Director: Lewis Gilbert
Year: 1977
Gross in Millions: $185.4



Printing bucket #17:

Title: Live and Let Die
Director: Guy Hamilton
Year: 1973
Gross in Millions: $161.8

Title: The World is Not Enough
Director: Michael Apted
Year: 1999
Gross in Millions: $362.0



Printing bucket #18:



Printing bucket #19:

Title: On Her Majesty's Secret Service
Director: Peter R. Hunt
Year: 1969
Gross in Millions: $82.0

Title: Moonraker
Director: Lewis Gilbert
Year: 1979
Gross in Millions: $210.3



Printing bucket #20:



Printing bucket #21:

Title: Diamonds are Forever
Director: Guy Hamilton
Year: 1971
Gross in Millions: $116.0



Printing bucket #22:



Printing bucket #23:

Title: For Your Eyes Only
Director: John Glen
Year: 1981
Gross in Millions: $195.3



Printing bucket #24:

Title: The Living Daylights
Director: John Glen
Year: 1987
Gross in Millions: $191.2



Printing bucket #25:




End of database!

Please select from one of the following options:

A. Add a Movie
D. Display all Movies
R. Remove a Movie
S. Search for a Movie
X. Exit

Enter your choice: R

Removing a movie!

Enter the title: Moonraker
Enter the director: Lewis Gilbert

Moonraker was removed!

Please select from one of the following options:

A. Add a Movie
D. Display all Movies
R. Remove a Movie
S. Search for a Movie
X. Exit

Enter your choice: S

Searching for a movie!

Enter the title: Moonraker
Enter the director: Lewis Gilbert

Moonraker is not in the database.

Please select from one of the following options:

A. Add a Movie
D. Display all Movies
R. Remove a Movie
S. Search for a Movie
X. Exit

Enter your choice: R

Removing a movie!

Enter the title: Moonraker
Enter the director: Lewis Gilbert

I cannot find Moonraker in the database.

Please select from one of the following options:

A. Add a Movie
D. Display all Movies
R. Remove a Movie
S. Search for a Movie
X. Exit

Enter your choice: S

Searching for a movie!

Enter the title: Casino Royale
Enter the director: Ken Hughes

Casino Royale is in the database!

Please select from one of the following options:

A. Add a Movie
D. Display all Movies
R. Remove a Movie
S. Search for a Movie
X. Exit

Enter your choice: Z

Invalid Selection!

Please select from one of the following options:

A. Add a Movie
D. Display all Movies
R. Remove a Movie
S. Search for a Movie
X. Exit

Enter your choice: Z

Invalid Selection!

Please select from one of the following options:

A. Add a Movie
D. Display all Movies
R. Remove a Movie
S. Search for a Movie
X. Exit

Enter your choice: X

Goodbye!


What to Submit
  • Once you are certain your program is working as shown above, upload your files to Canvas under Lab 7.
  • You must submit the following files: Movie.java, Hash.java, HashTest.java, List.java, MovieDatabase.java, as well as the following JUnit Test Files (3 calls to assertEquals per test file):
    • HashTest.java
    • CountBucketTest.java
    • GetNumElementsTest.java
    • SearchTest.java
    • InsertTest.java
    • RemoveTest.java

How You Will Be Graded
  • You will receive 10 points for a correct Movie.java.
  • You will receive 70 points for a correct Hash.java, along with a HashTest.java (7 points per correct method + 1 pt per test file)
  • You will receive 20 points for a MovieDatabase.java that works identically to the example above (including formatting).