Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!