CPSC 233: Mini-Assignment #6
December 2 at 4 PM
New Concepts to be applied for the assignment
- Conditional and unconditional display and accessing of data in a linked
list
Overview
To get credit for this assignment you must work with the starting code provided in class
Node and the Driver
class. You cannot change the code in these classes and you cannot write your own
versions. The source code can be found in the course directory under:
/home/233/assignments/mini_assignment6/code.
In addition there is a third class that you must use, the
Manager class. You
cannot change the attributes or the two methods provided (the
constructor() and the
add() method) but you
will be required to implement the two versions of the
display() method:
- display():
steps through the list starting with the first node and displays the data
for each node (on its own line) up to and including the last node.
- displayOverCutOff():
similar to the previous method. However the data for a node will only be
displayed if it exceeds the cutoff which in this case is defined by the
named constant "CUT_OFF" in the Manager class.
To get credit your program should display all nodes in the list and then
display nodes which exceed the cut-off. (Implement the appropriate methods and
uncomment out the method calls in the Driver). For your convenience there is
already a blank line that will separate the calls to each display method.
Everyone starts off with a grade point of zero. Completely and correctly
implementing one of the two methods earns you 2 grade points. That is,
implementing one method will earn you a grade point of 2.0. Implementing both
methods will earn you a grade point of 4.0.
Sample output
There's a sample output file in the course directory under:
/home/233/assignments/mini_assignment6/output
Submitting your work:
- Assignments (source code/'dot-java' file) must be electronically
submitted according to [the assignment submission requirements]
using [D2L].
Although you can assume that TAs have access to the two predefined classes
submitting them with the modified Manager class will make
marking easier. (D2L bundles all your submitted files into a zip document
and when the document is uncompressed all three source code files will be
placed into a separate directory one for each student).
- As a reminder, you are not allowed to work in groups for this class.
Copying the work of another student will be
regarded as academic misconduct (cheating). For additional details about
what is and is not okay for this class please refer to the following
[link].
External libraries that can be used (unless otherwise you can not assume
that you can use the library).
- You cannot use methods other than the ones for output:
printf(), print(),
println() as well
as the random number generator method
nextInt(). There's no need for input for this
assignment.