---+ Linked List: Spring 2024 ---++ Learning Objective(s) 1 Learn to implement and use linked lists ---++ Overview of the Program This lab will help with the final lab. You are to write a program to build and maintain a "worm" via a linked list. A worm is made up of segments. Each segment has an address (row and column) and must be in a row/column with the segment before it and in a row/column in with the segment after it.<br><br> We will use the direction keys associated with vi to move the worm. <b>h</b> is for left, <b>j</b> is for down, <b>k</b> is for up, and <b>l</b> is for right. There are also four other "commands": <b>+</b> to add a segment on at the end of the worm, <b>-</b> to delete the first segment of the worm, <b>=</b> to display the worm, and <b>q</b> to quit. ---++ Specifics * This program is to be solely text based (for now). * The worm starts out with 6 segments with the head at (10, 10) and the segment in a column below it. * The worm is allowed to move anywhere (there is no "limit" to what the row or column can be). * A worm also has a color that should be gotten from the user when it is first created * The main method should be found in a program called *WormDriver* * The input should be via command line argument . * You must use a linked list. * You should have the following classes: * Worm * Segment * Lnode * !LinkedList. This can be any of the four types of linked lists we covered in class. You are allowed to maintain a direct link to the last item in the list. * The design (UML and testing plan) should be done before starting to code. However, this is a one week lab and you will only be turning in the solution (the pdf and the software) * create a zip folder containing only the following (and submit it) * only one file (as a pdf) with the completed software development report * all the .java files needed to run the program * any input files you might want to have the grader use when running the program ---++ Optional improvements None this week.
This topic: CenterForComputing
>
WebHome
>
Syllabi
>
SyllabiSpring2024
>
CSC221SylS2024
>
CSC221f2024LinkedListLab
Topic revision: r1 - 2024-03-06 - CathyBareiss
Copyright © 2008-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback