Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a driver program that obtains the input n, a list of n suitors' names, and a list of n-1 integers to be used
Write a driver program that obtains the input n, a list of n suitors' names, and a list of n-1 integers to be used as "rotate steps." Using the class you have written, the program prints the names of the rejected suitors (in the order of rejection), and then prints the name of the lucky guy. 6. Wedding Lottery II Write an appropriate graphical user interface for the Wedding Lottery problem. The interface should allow the princess to specify the list of suitors using commands of the form add name. Once the princess has entered all the names, she presses a button labeled "Choose" to move from the input phase to the selection phase. In the selection phase, the user interface displays a list of suitors already rejected and another list of suitors still under consideration. The interface will have a text field in which the princess can enter a number for the next rotate step. As long as there is more than one suitor left, the program eliminates a suitor each time the princess types a number into the rotate step text field. 7. Adjacency List Input Create a file containing the adjacency list data given at the end of this chapter, and then modify the program in Code Listing 19-6 so that it reads the file and uses the data found in the file to build the adjacency list structure. Use an array of strings to keep track of the association between node names and node numbers that is given at the beginning of the file, and then use an array or an ArrayList of lists of numbers for the adiacency list structure Print the adiacency list twice: once using numbers to Hi 87F 4 ENG
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