Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Part 1. Solving using an ArrayList and its inbuilt methods (10 points): Write a Java program and do the following steps: (one-by-one) a) Create an

image text in transcribed

image text in transcribed

image text in transcribed

Part 1. Solving using an ArrayList and its inbuilt methods (10 points): Write a Java program and do the following steps: (one-by-one) a) Create an ArrayList and add the following names: i. Xiu Wang ii. Jackson Robin iii. Samantha Kelly iv. Yusuf Khan v. Hannah Taylor vi. Amaya Jones b) Display your ArrayList using any one of the three cursors (Enumeration, Iterator or Listiterator) c) Ask the user to enter a new name and get the user input. d) Add the user's name into the ArrayList and display the ArrayList. e) Ask the user to select a name from the ArrayList to be removed. f) Receive the user's input and remove the corresponding name from the ArrayList and display the resulting ArrayList. g) Ask the user to select a name from the ArrayList and also to provide an alternative name to be replaced with the selected name. h) Receive the user input and replace the selected name with the new name. (You must perform replace operation and should not perform remove). i) Display the ArrayList. Implement the following using Queue in the same Java program as in Part I. a) Create a Queue and add the following ID numbers: i. 14788 ii. 10652 iii. 13764 iv. 12785 v. 10325 vi. 11008 b) Display the Queue using any one of the three cursors (Enumeration, Iterator or Listiterator) c) Ask the user to enter a new ID number and add to Queue and display it. d) Remove only the head element of the Queue and display the removed element. e) Display only the current head element of the Queue. f) Display all the elements present in the Queue. g) Ask the user to enter a valid index number within the size range of the Queue. h) Receive the user input and display the element present at the given index. i) Ask the user to enter an ID number of their choice. j) Search for user given ID number in the Queue and display "ID number is present" if it is present in the Queue or display "ID number is present" if it is not present in the Queue. - Create and implement a new LinkedList Node in the same Java Program as in previous question. - The Class Node name is "StringLinkedList". This Linked List node only stores 'string' data type. You should not change the name of the node. - Write the code for the following operations for the "StringLinkedList" Node in the main() method of the Java program. Create the following three nodes and link the nodes Print the StringLinkedList Insert a new node "University" and link the node based on the diagram. Print the StringLinkedList Delete node "Union" and print the StringLinkedList Insert a new node "IT" and link the node based on the diagram. Print the StringLinkedList - Implement a method "deleteAfter(String e) that deletes the string present after the given string input ' e ' in the "StringLinkedList

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

Current Trends In Database Technology Edbt 2006 Edbt 2006 Workshops Phd Datax Iidb Iiha Icsnw Qlqp Pim Parma And Reactivity On The Web Munich Germany March 2006 Revised Selected Papers Lncs 4254

Authors: Torsten Grust ,Hagen Hopfner ,Arantza Illarramendi ,Stefan Jablonski ,Marco Mesiti ,Sascha Muller ,Paula-Lavinia Patranjan ,Kai-Uwe Sattler ,Myra Spiliopoulou ,Jef Wijsen

2006th Edition

3540467882, 978-3540467885

More Books

Students also viewed these Databases questions