Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

SFor this program you will create a menu method that returns the user s choice ) . The user should be allowed to enter userNum

SFor this program you will create a menu method that returns the users choice). The user should be allowed to enter userNum number of items in both lists (ensure the userNum is a positive integer). Use an int variable called temp to hold each list number the user enters until it is greater than zero and entered into the list. The user should be able to enter integers that are greater than zero for the lists. The program should have the user enter new lists every time they make a choice. It should continue until the user enters 4 to exit. You will need to import com.deitel.ch22.List and EmptyListException. The .java files are included in the com.dietel.ch22.Lists and EmptyListException (located in RequiredFiles folder). You will need to create a menu method that retrieves user input and returns the users choice to the method call in the main. Be user to only return an integer in the range 1 through 4. Use the following choices: Enter 1 to concatenate two lists: Enter 2 to insert numbers into an ordered list: Enter 3 to merge two ordered lists: Enter 4 to Exit: You need two methods called enterList and enterSortedList. You will also need to create methods for concatenateLists, insertIntoOrderedList, and mergeOrderedLists. The concatenateLists method will use the enterList method. The instertIntoOrderedList and the mergeOrderedList methods require the SortedList class (located in RequiredFiles folder). The enterSortedList method is needed twice in the mergeOrderedLists and once in the insertIntoOrderedList method. The insertIntoOrderedList should add userNum numbers to the sorted list sorted1 which should use the insertInOrder method from the SortedList class. In each method, the list should be printed after the change has been completed. The program should continue to loop until the user enters 4 to exit.

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2022 Grenoble France September 19 23 2022 Proceedings Part 4 Lnai 13716

Authors: Massih-Reza Amini ,Stephane Canu ,Asja Fischer ,Tias Guns ,Petra Kralj Novak ,Grigorios Tsoumakas

1st Edition

3031264118, 978-3031264115

More Books

Students also viewed these Databases questions