Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hello, I need help for this JAVA homework: Programming Assignment - Linked Lists Minimal Documentation Required (no javadoc) Purpose The purpose of this assignment is

Hello, I need help for this JAVA homework:

Programming Assignment - Linked Lists

Minimal Documentation Required (no javadoc)

Purpose

The purpose of this assignment is to introduce you to basic operations on a linked list.

Specifics

Design a program that generates a linked list of randomly generated Integer objects. Present a menu at program start that gives the user the following options (most of these options will have corresponding methods in a Linked List class):

1. Create a new list. The size will be specified by the user, make sure a non-negative value is entered. If there is a pre-existing list when this option is chosen, make sure you delete the contents of that list before creating your new list.

2. Sort the list. How you implement this is up to you. You can insert items in the list such that the list is always in sorted order or you can write a sort routine. You may not call a sort routine provided by the Java API.

3. Print the list (to the screen), one number per line.

4. Extra credit 5 points: Print the list in reverse order (to the screen), one number per line. If you do not attempt the extra credit, make this menu choice display the message Extra credit not attempted.

5. Generate a sub-list that contains all the even numbers in the current list. This list should be returned and the contents should be displayed (to the screen), one number per line.

6. Print the contents of every "nth" node in the list. Obtain the "n" from the user, ensure it is greater than 0.

7. Delete node(s) containing an integer value entered by the user. You should report how many were deleted to the user.

8. Delete the contents of the current list.

9. Quit

You may use any linked list implementation you wish (singly linked, doubly linked, dummy head node, circular).

In addition to your LinkedList class, include a driver file called ListTester that will contain the menu and anything else you deem necessary (perhaps a utility to generate random Integers...).

Keep things modular and encapsulate your data properly -- do not let anything outside the Linked List class have direct access to any of the nodes.

Do not accept invalid input of any type from the user and do not let user input crash your program.

To Turn In:

This assignment must be submitted in working order by posted due date (see Canvas for due date.) Submit a zip file with:

1. your source files

2. minimal documentation (be sure and give at least a brief description of the program, document anything that doesn't work.

Thank you.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Microsoft Visual Basic 2017 For Windows Web And Database Applications

Authors: Corinne Hoisington

1st Edition

1337102113, 978-1337102117

Students also viewed these Databases questions