Answered step by step
Verified Expert Solution
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 userschoice The user should be allowed to enter userNum number of items in both lists ensure theuserNum is a positive integer Use an int variable called temp to hold each list number the userenters until it is greater than zero and entered into the list. The user should be able to enterintegers that are greater than zero for the lists. The program should have the user enter newlists every time they make a choice. It should continue until the user enters to exit. You willneed to import com.deitel.chList and EmptyListException. The java files are included in thecomdietel.chLists and EmptyListException located in RequiredFiles folderYou will need to create a menu method that retrieves user input and returns the users choiceto the method call in the main. Be user to only return an integer in the range through Usethe following choices:Enter to concatenate two lists:Enter to insert numbers into an ordered list:Enter to merge two ordered lists:Enter to Exit:You need two methods called enterList and enterSortedList. You will also need to createmethods for concatenateLists, insertIntoOrderedList, and mergeOrderedLists. TheconcatenateLists method will use the enterList method. The instertIntoOrderedList and themergeOrderedList methods require the SortedList class located in RequiredFiles folder TheenterSortedList method is needed twice in the mergeOrderedLists and once in theinsertIntoOrderedList method. The insertIntoOrderedList should add userNum numbers to thesorted list sorted which should use the insertInOrder method from the SortedList class. Ineach method, the list should be printed after the change has been completed. The programshould continue to loop until the user enters to exit.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started