Lab 13 Suitor Game A princess in a faraway land has many suitors for her hand in marriage. She decides to choose one to marry by lining all of them up in a single line, then walking down the line,...


Solvethis problem

Preview the document
using a LinkedList or an ArrayList.


Data files are here:



MaleNames2.txt

Preview the document



MaleNames.txt

Preview the document


A spreadsheet to demonstrate the algorithm with a short number of suitors is hereSuitorSequence.xlsx

Preview the document


Paste the output from your final run of the program (using the larger file) in a comment at the end of the program




Lab 13 Suitor Game A princess in a faraway land has many suitors for her hand in marriage. She decides to choose one to marry by lining all of them up in a single line, then walking down the line, counting by 3’s, and eliminating every 3rd one until she is down to just one. When she is at the end of the line, she will continue by going back to the beginning of the line, maintaining her count. Therefore, if she is on a count of 2, and at the end of the line, the first position in line will be a count of 3. There is a demonstration of how this works in the table below. This list of Suitors starts with only 15 so you can follow it through only 6 passes through the list as it shrinks down to 1: Create a program to figure out which of the suitors the princess should select. Use a LinkedList or an ArrayList of Strings to represent her suitors. It is probably easiest to model on Lab 13, and add a method to determine the lucky suitor. You will need to build the list of suitors by reading the file MaleNames2.txt, which has over 1000 names. You do not need to insert the names into a LinkedList or an ArrayList in any particular order, but you will need to determine the algorithm for removing the suitor’s from the list until there is only one left. For testing purposes, there is a short list named MaleNames.txt with the 15 names used in the table above. Your final output should be the name of the “lucky” suitor. My sample runs are below: Enter the file name that contains the names of the suitors MaleNames.txt Suitor Abraham is the lucky guy with a list of 15 names. Here is one with intermediate printouts Enter the file name that contains the names of the suitors MaleNames.txt removing Abe at 2 removing Abram at 4 removing Adan at 6 removing Adrian at 8 removing Aidan at 10 removing Abel at 2 removing Adam at 4 removing Agustin at 6 removing Abdul at 1 removing Adolfo at 3 removing Aaron at 0 removing Adolph at 2 removing Adalberto at 1 removing Ahmed at 1 Suitor Abraham is the lucky guy with a list of 15 names. Aaron Abdul Abe Abel Abraham Abram Adalberto Adam Adan Adolfo Adolph Adrian Agustin Ahmed Aidan Aaron Abdul Abe Abel Abraham Abram Adalberto Adam Adan Adolfo Adolph Adrian Agustin Ahmed Aidan Alan Albert Alberto Alden Aldo Alec Alex Alexander Alfonzo Alfred Alfredo Allen Alonzo Alphonse Alphonso Alton Alva Alvaro Alvin Amado Ambrose Amos Anderson Andre Andrew Angelo Anibal Anthony Antoine Anton Antonio Antony Antwan Archie Arden Ariel Arlen Arlie Armand Armando Arnold Arron Arthur Arturo Asa Ashley Aubrey August Augustine Augustus Aurelio Austin Avery Barney Barrett Barry Bart Barton Basil Beau Ben Benedict Benito Benjamin Bennett Benny Benton Bernard Bernardo Bernie Berry Bert Bertram Bill Billie Billy Blaine Blair Blake Bo Bob Bobby Booker Boris Boyce Boyd Bradford Bradley Bradly Brady Brain Branden Brandon Brant Brendan Brendon Brent Brenton Brett Brian Brice Britt Brock Broderick Brooks Bruce Bruno Bryan Bryant Bryce Bryon Buck Bud Buddy Buford Burl Burt Burton Buster Byron Caleb Calvin Cameron Carey Carl Carlo Carlos Carlton Carmelo Carmen Carmine Carol Carrol Carroll Carson Carter Cary Casey Cecil Cedric Cedrick Cesar Chad Chadwick Chance Chang Charles Charley Charlie Chas Chase Chauncey Chester Chet Chi Chong Chris Christian Christoper Christopher Chuck Chung Clair Clarence Clark Claud Claude Claudio Clay Clayton Clement Clemente Cleo Cletus Cleveland Cliff Clifford Clifton Clint Clinton Clyde Cody Colby Cole Coleman Colin Collin Colton Columbus Connie Conrad Cordell Corey Cornelius Cornell Cortez Cory Courtney Coy Craig Cristobal Cristopher Cruz Curt Curtis Cyril Cyrus Dale Dallas Dalton Damian Damien Damion Damon Dan Dana Dane Danial Daniel Danilo Dannie Danny Dante Darell Daren Darin Dario Darius Darnell Daron Darrel Darrell Darren Darrick Darrin Darron Darryl Darwin Daryl Dave David Davis Dean Deandre Deangelo Dee Del Delbert Delmar Delmer Demarcus Demetrius Denis Dennis Denny Denver Deon Derek Derrick Desmond Devin Devon Dewey Dewitt Dexter Dick Diego Dillon Dino Dion Dirk Domenic Domingo Dominic Dominick Dominique Don Donald Dong Donn Donnell Donnie Donny Donovan Dorian Dorsey Doug Douglas Doyle Drew Duane Dudley Duncan Dustin Dusty Dwain Dwayne Dwight Dylan Earl Earnest Eddie Edgar Edgardo Edison Edmond Edmund Edmundo Eduardo Edward Edwardo Edwin Efrain Efren Elbert Elden Eldon Eldridge Eli Elias Elijah Eliseo Elisha Elliot Elliott Ellis Ellsworth Elmer Elmo Eloy Elroy Elton Elvin Elvis Elwood Emanuel Emerson Emery Emil Emile Emilio Emmanuel Emmett Emmitt Emory Enoch Enrique Erasmo Eric Erich Erick Erik Erin Ernest Ernesto Ernie Errol Ervin Erwin Esteban Ethan Eugene Eugenio Eusebio Evan Everett Everette Ezekiel Ezequiel Ezra Fabian Faustino Fausto Federico Felipe Felix Felton Ferdinand Fermin Fernando Fidel Filiberto Fletcher Florencio Florentino Floyd Forest Forrest Foster Frances Francesco Francis Francisco Frank Frankie Franklin Franklyn Fred Freddie Freddy Frederic Frederick Fredric Fredrick Freeman Fritz Gabriel Gail Gale Galen Garfield Garland Garret Garrett Garry Garth Gary Gaston Gavin Gayle Gaylord Genaro Gene Geoffrey George Gerald Geraldo Gerard Gerardo German Gerry Gil Gilbert Gilberto Gino Giovanni Giuseppe Glen Glenn Gonzalo Gordon Grady Graham Graig Grant Granville Greg Gregg Gregorio Gregory Grover Guadalupe Guillermo Gus Gustavo Guy Hai Hal Hank Hans Harlan Harland Harley Harold Harris Harrison Harry Harvey Hassan Hayden Haywood Heath Hector Henry Herb Herbert Heriberto Herman Herschel Hershel Hilario Hilton Hipolito Hiram Hobert Hollis Homer Hong Horace Horacio Hosea Houston Howard Hoyt Hubert Huey Hugh Hugo Humberto Hung Hunter Hyman Ian Ignacio Ike Ira Irvin Irving Irwin Isaac Isaiah Isaias Isiah Isidro Ismael Israel Isreal Issac Ivan Ivory Jacinto Jack Jackie Jackson Jacob Jacques Jae Jaime Jake Jamaal Jamal Jamar Jame Jamel James Jamey Jamie Jamison Jan Jared Jarod Jarred Jarrett Jarrod Jarvis Jason Jasper Javier Jay Jayson Jc Jean Jed Jeff Jefferey Jefferson Jeffery Jeffrey Jeffry Jerald Jeramy Jere Jeremiah Jeremy Jermaine Jerold Jerome Jeromy Jerrell Jerrod Jerrold Jerry Jess Jesse Jessie Jesus Jewel Jewell Jim Jimmie Jimmy Joan Joaquin Jody Joe Joel Joesph Joey John Johnathan Johnathon Johnie Johnnie Johnny Johnson Jon Jonah Jonas Jonathan Jonathon Jordan Jordon Jorge Jose Josef Joseph Josh Joshua Josiah Jospeh Josue Juan Jude Judson Jules Julian Julio Julius Junior Justin Kareem Karl Kasey Keenan Keith Kelley Kelly Kelvin Ken Kendall Kendrick Keneth Kenneth Kennith Kenny Kent Kenton Kermit Kerry Keven Kevin Kieth Kim King Kip Kirby Kirk Korey Kory Kraig Kris Kristofer Kristopher Kurt Kurtis Kyle Lacy Lamar Lamont Lance Landon Lane Lanny Larry Lauren Laurence Lavern Laverne Lawerence Lawrence Lazaro Leandro Lee Leif Leigh Leland Lemuel Len Lenard Lenny Leo Leon Leonard Leonardo Leonel Leopoldo Leroy Les Lesley Leslie Lester Levi Lewis Lincoln Lindsay Lindsey Lino Linwood Lionel Lloyd Logan Lon Long Lonnie Lonny Loren Lorenzo Lou Louie Louis Lowell Loyd Lucas Luciano Lucien Lucio Lucius Luigi Luis Luke Lupe Luther Lyle Lyman Lyndon Lynn Lynwood Mac Mack Major Malcolm Malcom Malik Man Manual Manuel Marc Marcel Marcelino Marcellus Marcelo Marco Marcos Marcus Margarito Maria Mariano Mario Marion Mark Markus Marlin Marlon Marquis Marshall Martin Marty Marvin Mary Mason Mathew Matt Matthew Maurice Mauricio Mauro Max Maximo Maxwell Maynard Mckinley Mel Melvin Merle Merlin Merrill Mervin Micah Michael Michal Michale Micheal Michel Mickey Miguel Mike Mikel Milan Miles Milford Millard Milo Milton Minh Miquel Mitch Mitchel Mitchell Modesto Mohamed Mohammad Mohammed Moises Monroe Monte Monty Morgan Morris Morton Mose Moses Moshe Murray Myles Myron Napoleon Nathan Nathanael Nathanial Nathaniel Neal Ned Neil Nelson Nestor Neville Newton Nicholas Nick Nickolas Nicky Nicolas Nigel Noah Noble Noe Noel Nolan Norbert Norberto Norman Normand Norris Numbers Octavio Odell Odis Olen Olin Oliver Ollie Omar Omer Oren Orlando Orval Orville Oscar Osvaldo Oswaldo Otha Otis Otto Owen Pablo Palmer Paris Parker Pasquale Pat Patricia Patrick Paul Pedro Percy Perry Pete Peter Phil Philip Phillip Pierre Porfirio Porter Preston Prince Quentin Quincy Quinn Quintin Quinton Rafael Raleigh Ralph Ramiro Ramon Randal Randall Randell Randolph Randy Raphael Rashad Raul Ray Rayford Raymon Raymond Raymundo Reed Refugio Reggie Reginald Reid Reinaldo Renaldo Renato Rene Reuben Rex Rey Reyes Reynaldo Rhett Ricardo Rich Richard Richie Rick Rickey Rickie Ricky Rico Rigoberto Riley Rob Robbie Robby Robert Roberto Robin Robt Rocco Rocky Rod Roderick Rodger Rodney Rodolfo Rodrick Rodrigo Rogelio Roger Roland Rolando Rolf Rolland Roman Romeo Ron Ronald Ronnie Ronny Roosevelt Rory Rosario Roscoe Rosendo Ross Roy Royal Royce Ruben Rubin Rudolf Rudolph Rudy Rueben Rufus Rupert Russ Russel Russell Rusty Ryan Sal Salvador Salvatore Sam Sammie Sammy Samual Samuel Sandy Sanford Sang Santiago Santo Santos Saul Scot Scott Scottie Scotty Sean Sebastian Sergio Seth Seymour Shad Shane Shannon Shaun Shawn Shayne Shelby Sheldon Shelton Sherman Sherwood Shirley Shon Sid Sidney Silas Simon Sol Solomon Son Sonny Spencer Stacey Stacy Stan Stanford Stanley Stanton Stefan Stephan Stephen Sterling Steve Steven Stevie Stewart Stuart Sung Sydney Sylvester Tanner Taylor Ted Teodoro Terence Terrell Terrence Terry Thad Thaddeus Thanh Theo Theodore Theron Thomas Thurman Timothy Titus Tobias Toby Todd Tom Toney Tony Tory Tracy Travis Trent Trenton Trevor Trey Trinidad Tristan Troy Truman Ty Tyler Tyree Tyrell Tyron Tyrone Tyson
Apr 16, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here