lab05 : Hash Tables cont.
| num | ready? | description | assigned | due |
|---|---|---|---|---|
| lab05 | true | Hash Tables cont. | Mon 09/27 08:00AM | Fri 12/10 11:59PM |
Goals
This is a continuation of the previous lab. You will add the “Big Three” member functions (copy constructor, assigment operator, and destructor) to your Table class. You will need a slightly revised Entry class, which counts the number of Entry objects that are created and destroyed, so we can test your destructor.
Step by Step
Step 1: Get the lab05 starter code into your repository directory
In this step, we are going to copy the lab05 starter files from the instructors directory into your ~/cs32/lab05 directory.
The files are in the instructors directory at
~richert/public_html/cs32/misc/s18/lab05/*
and also accessible via the URL
http://cs.ucsb.edu/~richert/cs32/misc/s18/lab05/
You want to copy these files into your ~/cs32/lab05 directory.
Step 2: Update your Table’s header file
-
Add the declarations (not the definitions) to
table.h. -
Both your copy constructor and assignment operator must take a constant reference to a
Tableobject as the only parameter. -
Your assignment operator must return the calling object as a reference.
Step 3: Update your Tables implementation file
-
Add the definitions (not the declarations) to
table.cpp. You may use tools from any of the standard libraries except<map>,<set>,<unordered_map>and<unordered_set>. -
Both the copy constructor and the assignment operator must make completely independent copies of the source
Table. In other words, ifTable xis a copy ofTable y, then future changes toxwill not affecty, and vice-versa. -
Your destructor must release all memory allocated via the operator
newor calls tomalloc(). -
If your get, remove or output functions did not pass the time tests for Lab04, then you should improve them now.
Step 4: Testing
Compile and test your program at CSIL (by connecting remotely is okay). Create your own testing program(s) to do so. After you think that all parts are working properly, you should verify that your implementation compiles and executes correctly with the demonstration program from the previous lab.
Step 5: Submitting via Gradescope
You will turn in both table.h and table.cpp.
The lab assignment “Lab05” should appear in your Gradescope dashboard in CMPSC 32. If you haven’t submitted anything for this assignment yet, Gradescope will prompt you to upload your files.
For this lab, you will need to upload your modified files (i.e. table.h and table.cpp). You either can navigate to your file, “drag-and-drop” them into the “Submit Programming Assignment” window, or even use a GitHub repo to submit your work.
If you already submitted something on Gradescope, it will take you to their “Autograder Results” page. There is a “Resubmit” button on the bottom right that will allow you to update the files for your submission.
For this lab, if everything is correct, you’ll see a successful submission passing all of the autograder tests.