Example Report

Hi everybody,

I've copied an example of the program test report for assignment 8 below. Some of you had trouble getting your programs to work well. Please have a look at the output of this assignment. Please also let me know if you need an example implementation.

As we discussed in the lab, there are basically four cases for each method that you want to cover in this assignment. Let's use the findPrevious method as an example:

  1. There's no matching node of value key. Return null in this case.

  2. The matching node has a left subtree. Return the right-most node's value of its left subtree.

  3. The matching node doesn't have a left subtree. Return the first-parent node's value that is smaller than the key.

  4. If no such parent exists. Throw NoSuchElementException.

Also, we need to handle the case when the tree is empty. So, I made two database files to test the programs. The first has nodes, and the second doesn't. Please scroll down to see the .csv file and its graph.

If you submitted your assignment 8, you will soon receive an email from me with your report and score. If you haven't received the email by late tonight, let me know. Also let me know if you have any questions regarding your score.

Cheers!
Jade


Here is your score for Assignment 8.

Score: TDB%

Let me know if you have any questions regarding your score. And let me know if you want a copy of an example implementation for the assignment.

Regards,
Jade

Grading Guildelines


Test Results

The following files was used during the tests:

% java ChengJade8
+=========================================================================+ | taxpayers | |-------------------------------------------------------------------------| | please enter | | | | [1] add a new taxpayer record | | [2] change tax for a taxpayer | | [3] remove a taxpayer record | | [4] display the database | | [5] find the previous record | | [6] find the next record | | [7] exit program | | | +=========================================================================+ Choice: 5 +=========================================================================+ | Message | |-------------------------------------------------------------------------| | enter SSN of taxpayer | +=========================================================================+ Input: 1 no previous record for SSN 1 +=========================================================================+ | taxpayers | |-------------------------------------------------------------------------| | please enter | | | | [1] add a new taxpayer record | | [2] change tax for a taxpayer | | [3] remove a taxpayer record | | [4] display the database | | [5] find the previous record | | [6] find the next record | | [7] exit program | | | +=========================================================================+ Choice: 5 +=========================================================================+ | Message | |-------------------------------------------------------------------------| | enter SSN of taxpayer | +=========================================================================+ Input: 2 previous record for SSN 2: --> name: Adam, SSN: 1, tax due: 101.0 +=========================================================================+ | taxpayers | |-------------------------------------------------------------------------| | please enter | | | | [1] add a new taxpayer record | | [2] change tax for a taxpayer | | [3] remove a taxpayer record | | [4] display the database | | [5] find the previous record | | [6] find the next record | | [7] exit program | | | +=========================================================================+ Choice: 5 +=========================================================================+ | Message | |-------------------------------------------------------------------------| | enter SSN of taxpayer | +=========================================================================+ Input: 3 previous record for SSN 3: --> name: Bill, SSN: 2, tax due: 102.0 +=========================================================================+ | taxpayers | |-------------------------------------------------------------------------| | please enter | | | | [1] add a new taxpayer record | | [2] change tax for a taxpayer | | [3] remove a taxpayer record | | [4] display the database | | [5] find the previous record | | [6] find the next record | | [7] exit program | | | +=========================================================================+ Choice: 5 +=========================================================================+ | Message | |-------------------------------------------------------------------------| | enter SSN of taxpayer | +=========================================================================+ Input: 4 previous record for SSN 4: --> name: Cris, SSN: 3, tax due: 103.0 +=========================================================================+ | taxpayers | |-------------------------------------------------------------------------| | please enter | | | | [1] add a new taxpayer record | | [2] change tax for a taxpayer | | [3] remove a taxpayer record | | [4] display the database | | [5] find the previous record | | [6] find the next record | | [7] exit program | | | +=========================================================================+ Choice: 5 +=========================================================================+ | Message | |-------------------------------------------------------------------------| | enter SSN of taxpayer | +=========================================================================+ Input: 5 previous record for SSN 5: --> name: Dave, SSN: 4, tax due: 104.0 +=========================================================================+ | taxpayers | |-------------------------------------------------------------------------| | please enter | | | | [1] add a new taxpayer record | | [2] change tax for a taxpayer | | [3] remove a taxpayer record | | [4] display the database | | [5] find the previous record | | [6] find the next record | | [7] exit program | | | +=========================================================================+ Choice: 5 +=========================================================================+ | Message | |-------------------------------------------------------------------------| | enter SSN of taxpayer | +=========================================================================+ Input: 6 previous record for SSN 6: --> name: Eric, SSN: 5, tax due: 105.0 +=========================================================================+ | taxpayers | |-------------------------------------------------------------------------| | please enter | | | | [1] add a new taxpayer record | | [2] change tax for a taxpayer | | [3] remove a taxpayer record | | [4] display the database | | [5] find the previous record | | [6] find the next record | | [7] exit program | | | +=========================================================================+ Choice: 5 +=========================================================================+ | Message | |-------------------------------------------------------------------------| | enter SSN of taxpayer | +=========================================================================+ Input: 7 previous record for SSN 7: --> name: Fred, SSN: 6, tax due: 106.0 +=========================================================================+ | taxpayers | |-------------------------------------------------------------------------| | please enter | | | | [1] add a new taxpayer record | | [2] change tax for a taxpayer | | [3] remove a taxpayer record | | [4] display the database | | [5] find the previous record | | [6] find the next record | | [7] exit program | | | +=========================================================================+ Choice: 5 +=========================================================================+ | Message | |-------------------------------------------------------------------------| | enter SSN of taxpayer | +=========================================================================+ Input: 8 previous record for SSN 8: --> name: Greg, SSN: 7, tax due: 107.0 +=========================================================================+ | taxpayers | |-------------------------------------------------------------------------| | please enter | | | | [1] add a new taxpayer record | | [2] change tax for a taxpayer | | [3] remove a taxpayer record | | [4] display the database | | [5] find the previous record | | [6] find the next record | | [7] exit program | | | +=========================================================================+ Choice: 5 +=========================================================================+ | Message | |-------------------------------------------------------------------------| | enter SSN of taxpayer | +=========================================================================+ Input: 9 previous record for SSN 9: --> name: Hank, SSN: 8, tax due: 108.0 +=========================================================================+ | taxpayers | |-------------------------------------------------------------------------| | please enter | | | | [1] add a new taxpayer record | | [2] change tax for a taxpayer | | [3] remove a taxpayer record | | [4] display the database | | [5] find the previous record | | [6] find the next record | | [7] exit program | | | +=========================================================================+ Choice: 5 +=========================================================================+ | Message | |-------------------------------------------------------------------------| | enter SSN of taxpayer | +=========================================================================+ Input: 99 no matching record for SSN 99 +=========================================================================+ | taxpayers | |-------------------------------------------------------------------------| | please enter | | | | [1] add a new taxpayer record | | [2] change tax for a taxpayer | | [3] remove a taxpayer record | | [4] display the database | | [5] find the previous record | | [6] find the next record | | [7] exit program | | | +=========================================================================+ Choice: 6 +=========================================================================+ | Message | |-------------------------------------------------------------------------| | enter SSN of taxpayer | +=========================================================================+ Input: 1 next record for SSN 1: --> name: Bill, SSN: 2, tax due: 102.0 +=========================================================================+ | taxpayers | |-------------------------------------------------------------------------| | please enter | | | | [1] add a new taxpayer record | | [2] change tax for a taxpayer | | [3] remove a taxpayer record | | [4] display the database | | [5] find the previous record | | [6] find the next record | | [7] exit program | | | +=========================================================================+ Choice: 6 +=========================================================================+ | Message | |-------------------------------------------------------------------------| | enter SSN of taxpayer | +=========================================================================+ Input: 2 next record for SSN 2: --> name: Cris, SSN: 3, tax due: 103.0 +=========================================================================+ | taxpayers | |-------------------------------------------------------------------------| | please enter | | | | [1] add a new taxpayer record | | [2] change tax for a taxpayer | | [3] remove a taxpayer record | | [4] display the database | | [5] find the previous record | | [6] find the next record | | [7] exit program | | | +=========================================================================+ Choice: 6 +=========================================================================+ | Message | |-------------------------------------------------------------------------| | enter SSN of taxpayer | +=========================================================================+ Input: 3 next record for SSN 3: --> name: Dave, SSN: 4, tax due: 104.0 +=========================================================================+ | taxpayers | |-------------------------------------------------------------------------| | please enter | | | | [1] add a new taxpayer record | | [2] change tax for a taxpayer | | [3] remove a taxpayer record | | [4] display the database | | [5] find the previous record | | [6] find the next record | | [7] exit program | | | +=========================================================================+ Choice: 6 +=========================================================================+ | Message | |-------------------------------------------------------------------------| | enter SSN of taxpayer | +=========================================================================+ Input: 4 next record for SSN 4: --> name: Eric, SSN: 5, tax due: 105.0 +=========================================================================+ | taxpayers | |-------------------------------------------------------------------------| | please enter | | | | [1] add a new taxpayer record | | [2] change tax for a taxpayer | | [3] remove a taxpayer record | | [4] display the database | | [5] find the previous record | | [6] find the next record | | [7] exit program | | | +=========================================================================+ Choice: 6 +=========================================================================+ | Message | |-------------------------------------------------------------------------| | enter SSN of taxpayer | +=========================================================================+ Input: 5 next record for SSN 5: --> name: Fred, SSN: 6, tax due: 106.0 +=========================================================================+ | taxpayers | |-------------------------------------------------------------------------| | please enter | | | | [1] add a new taxpayer record | | [2] change tax for a taxpayer | | [3] remove a taxpayer record | | [4] display the database | | [5] find the previous record | | [6] find the next record | | [7] exit program | | | +=========================================================================+ Choice: 6 +=========================================================================+ | Message | |-------------------------------------------------------------------------| | enter SSN of taxpayer | +=========================================================================+ Input: 6 next record for SSN 6: --> name: Greg, SSN: 7, tax due: 107.0 +=========================================================================+ | taxpayers | |-------------------------------------------------------------------------| | please enter | | | | [1] add a new taxpayer record | | [2] change tax for a taxpayer | | [3] remove a taxpayer record | | [4] display the database | | [5] find the previous record | | [6] find the next record | | [7] exit program | | | +=========================================================================+ Choice: 6 +=========================================================================+ | Message | |-------------------------------------------------------------------------| | enter SSN of taxpayer | +=========================================================================+ Input: 7 next record for SSN 7: --> name: Hank, SSN: 8, tax due: 108.0 +=========================================================================+ | taxpayers | |-------------------------------------------------------------------------| | please enter | | | | [1] add a new taxpayer record | | [2] change tax for a taxpayer | | [3] remove a taxpayer record | | [4] display the database | | [5] find the previous record | | [6] find the next record | | [7] exit program | | | +=========================================================================+ Choice: 6 +=========================================================================+ | Message | |-------------------------------------------------------------------------| | enter SSN of taxpayer | +=========================================================================+ Input: 8 next record for SSN 8: --> name: Iris, SSN: 9, tax due: 109.0 +=========================================================================+ | taxpayers | |-------------------------------------------------------------------------| | please enter | | | | [1] add a new taxpayer record | | [2] change tax for a taxpayer | | [3] remove a taxpayer record | | [4] display the database | | [5] find the previous record | | [6] find the next record | | [7] exit program | | | +=========================================================================+ Choice: 6 +=========================================================================+ | Message | |-------------------------------------------------------------------------| | enter SSN of taxpayer | +=========================================================================+ Input: 9 no next record for SSN 9 +=========================================================================+ | taxpayers | |-------------------------------------------------------------------------| | please enter | | | | [1] add a new taxpayer record | | [2] change tax for a taxpayer | | [3] remove a taxpayer record | | [4] display the database | | [5] find the previous record | | [6] find the next record | | [7] exit program | | | +=========================================================================+ Choice: 6 +=========================================================================+ | Message | |-------------------------------------------------------------------------| | enter SSN of taxpayer | +=========================================================================+ Input: 99 no matching record for SSN 99 +=========================================================================+ | taxpayers | |-------------------------------------------------------------------------| | please enter | | | | [1] add a new taxpayer record | | [2] change tax for a taxpayer | | [3] remove a taxpayer record | | [4] display the database | | [5] find the previous record | | [6] find the next record | | [7] exit program | | | +=========================================================================+ Choice: 7
% java ChengJade8
+=========================================================================+ | taxpayers | |-------------------------------------------------------------------------| | please enter | | | | [1] add a new taxpayer record | | [2] change tax for a taxpayer | | [3] remove a taxpayer record | | [4] display the database | | [5] find the previous record | | [6] find the next record | | [7] exit program | | | +=========================================================================+ Choice: 4 +=========================================================================+ | taxpayers | |-------------------------------------------------------------------------| | please enter | | | | [1] add a new taxpayer record | | [2] change tax for a taxpayer | | [3] remove a taxpayer record | | [4] display the database | | [5] find the previous record | | [6] find the next record | | [7] exit program | | | +=========================================================================+ Choice: 5 +=========================================================================+ | Message | |-------------------------------------------------------------------------| | enter SSN of taxpayer | +=========================================================================+ Input: 99 no matching record for SSN 99 +=========================================================================+ | taxpayers | |-------------------------------------------------------------------------| | please enter | | | | [1] add a new taxpayer record | | [2] change tax for a taxpayer | | [3] remove a taxpayer record | | [4] display the database | | [5] find the previous record | | [6] find the next record | | [7] exit program | | | +=========================================================================+ Choice: 6 +=========================================================================+ | Message | |-------------------------------------------------------------------------| | enter SSN of taxpayer | +=========================================================================+ Input: 99 no matching record for SSN 99 +=========================================================================+ | taxpayers | |-------------------------------------------------------------------------| | please enter | | | | [1] add a new taxpayer record | | [2] change tax for a taxpayer | | [3] remove a taxpayer record | | [4] display the database | | [5] find the previous record | | [6] find the next record | | [7] exit program | | | +=========================================================================+ Choice: 7
Valid HTML 4.01 Valid CSS