Question: I am trying to write a simple linkedlist class that includes a main.java, linkedlist.java and node.java Here is the requirement of the program. I need
You are going to create a Linked List class - you are not allowed to use the Java LinkedList class described in Chapter 15. However, you should read chapter 15 to understand how the Java LinkedList class works. Your program will generate and manage random numbers. When the program first begins, it will display 200 random numbers. The random numbers will be stored in a linked list- sorted from smallest to largest. The numbers must all be 5 digits wide - smallest possible number will be 10,000 and the largest will be 99,999. The numbers will be displayed on the screen lined up nicely-10 columns, and as many rows as needed After the words are displayed, there will be a single line at the bottom that has all the possible commands. The commands are (R)emove, (N)ew, (F)ind, Size, Ave, (Qjuit. After the command is performed, the screen will re-display all the words in the format listed above. Ir (Ryemove is selected, the program will andomly select a number to remays, The selected number will be displaysd If (NJew is selected, the program will generate a new random number and insert it into the correct location in the linked along with its location. listThe program wi location 47" ill then display the new number and identify its location in the list. Example: "27654 was entered into If (F)ind is selected, the program will ask the user for a number. If the number is found, the program will say "xxxxx found in location x" where XXXXX is the number and x is the location of the number in the list. If the number is not found, the program will say "XXXXX not found" The Size will show how many numbers are in the list. The Ave will show the nearest integer average of all the numbers. Example screen shot: (1 create 22 words -they all display on the screen) 12345 12456 13467 15678 16756 17498 29876 34567 34679 34934 36786 37648 38765 39786 45678 47865 48987 50989 67859 74857 83765 98765 (R)emove (N)ew (Find Size:22 Ave:40636 (Quit > N #1 press N followed by the return key to add a new random number. 12345 12456 13467 15678 16756 17498 29876 34567 34679 34934 36786 37648 38765 39786 45678 47865 48987 50989 67859 74857 83765 98765 99346 99346 was added to location 23 (R)emove (N)ew (F)ind Size:22 Ave:40636 (Quit // I press R to remove a number 12345 12456 13467 15678 16756 17498 34567 34679 34934 36786 37648 38765 39786 4567847865 48987 50989 67859 74857 83765 98765 99346 29876 was removed (A)dd (R)emove(F)ind Size: 22 Ave:43794 (Quit
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
