reset password
Author Message
RandomAccess
Posts: 101
Posted 19:52 Sep 08, 2018 |

This is mostly trying to wrap my mind around the semantics In Lab 2, as the teacher provided us a package with java files already prepared for the lab that we're supposed to add to add to. First, the "addToCreateCycle ", is it fine to create two of them with different parameters as the other "add" methods do? Also, are we supposed to add tests to the JUnit Test provided, or create another JUnit Test, because I notice some of the tests on the provided JUnit test already do some of the things the assignment ask of me, should I write another version of those in the provided JUnit file? And if I do write a new JUnit Test file, should the original in along with the new file?

jhurley
Posts: 207
Posted 09:01 Sep 09, 2018 |
RandomAccess wrote:

This is mostly trying to wrap my mind around the semantics In Lab 2, as the teacher provided us a package with java files already prepared for the lab that we're supposed to add to add to. First, the "addToCreateCycle ", is it fine to create two of them with different parameters as the other "add" methods do? Also, are we supposed to add tests to the JUnit Test provided, or create another JUnit Test, because I notice some of the tests on the provided JUnit test already do some of the things the assignment ask of me, should I write another version of those in the provided JUnit file? And if I do write a new JUnit Test file, should the original in along with the new file?

add new JUnit test cases

you only need one version of addToCreateCycle, and it should take a reference to a Node<T> as its parameter.  

RandomAccess
Posts: 101
Posted 23:24 Sep 09, 2018 |

So from what I'm gathering, it's not supposed to have an element of generic data type T, is this correct?

jhurley
Posts: 207
Posted 06:37 Sep 10, 2018 |

The Nodes are Nodes<T>.  There is a constructor that can create a Node by taking it's data element and a reference to the next Node<T>.  Use that one from the test, rather than using the constructor that just takes an element and creates the Node.