COSC 2C
ASSIGNMENT 2C
Assignment 6 tests your knowledge of user-defined lists, stacks, queues, and priority queues (Chapter 24). You can and should start with the examples from the textbook/presentation and adapt them to the assignment at hand and use the appropriate names and add the additional code and requirements bellow.
Design a program/project/driver class YourNameAssignment2C and the following classes (with exact1 names, replace YourName with your actual first name or the name you go by):
Class Description
YourNameList Program the complete version of user-defined MyList class from Chapter 24 (meaning you need to add the code for all methods that were not coded in the textbook/presentation and have a “Left as an exercise” comment). Add an additional YourNameToString method that returns a string with the elements from the list in the format: [ElementPosition0, ElementPosition1, …, ElementPositionN-1]
YourNameArrayList Program a complete version of the user-defined MyArrayList class from Chapter 24 (all fields and methods) that uses the YourNameList instead of MyList and has an additional YourNameToString method that returns a string with the elements from the list in the format: [ElementPosition0, ElementPosition1, …, ElementPositionN-1].
YourNameLinkedList Program a complete version of the user-defined MyLinkedList class from Chapter 24 (all fields and methods) that uses the YourNameList instead of MyList and has an additional YourNameToString method that returns a string with the elements from the linked list in the format: [ElementPosition0, ElementPosition1, …, ElementPositionN-1].
YourNameStack Program a complete version of the user-defined GenericStack class from Chapter 24 and 19 (all fields and methods) that uses the YourNameArrayList instead of the pre- defined ArrayList used in textbook/presentation and has an additional YourNameToString method that returns a string with the elements from the stack in the format: [ElementPosition0, ElementPosition1, …, ElementPositionN-1].
YourNameQueue Program a complete version of the user-defined GenericQueue class from Chapter 24 (all fields and methods) that uses a YourNameLinkedList instead of the pre-defined LinkedList used in textbook and has an additional YourNameToString method that returns a string with the elements from the queue in the format: [ElementPosition0, ElementPosition1, …, ElementPositionN-1].
YourName Assignment2C Driver class main
Create an array of 10 integers, read the values from the user and create instances of the YourNameArrayList, YourNameLinkedList, YourNameStack, and YourNameQueue user-defined lists and test/demonstrate their functionality by using all their methods (e.g. add, remove, get, , indexOf, and YourNameToString / print the returned string).
Create a Microsoft Word screenshots document called YourNameAssignment2C-Screenshot.docx (replace YourName with your actual name) that contains screenshots of the entire JAVA source code in the editor window (for all the JAVA classes) and the entire output window (from the driver class). If the entire class JAVA source code or the output does not fit in one screenshot or is it not easily readable, create multiple screenshots and add them to the document.
Submit the following 7 files: the YourNameAssignment2C.java, YourNameList.java, YourNameArrayList.java, YourNameLinkedList.java, YourNameStack.java, YourNameQueue.java Java source code files and YourNameAssignment2C-Screenshots.docx screenshots document on eCampus under Assignment 2C. Do not archive the files (no ZIP, no RAR, etc) or submit other file formats.
1 Use the exact names (spelling, caps), parameters, returned values, functionality, and do not add or remove fields or methods. Yes, you may find examples in the textbook with different names and cases and with other methods, but you will need to adapt them to have this exact names and cases, to earn credit for the assignment.