Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

Hello. I'm looking for help with this program. The program language is JAVA. Thanks. Hotel Problem Problem: The Nirvana Hotel contain 100 rooms. We wish

Hello. I'm looking for help with this program. The program language is JAVA. Thanks.

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

Hotel Problem Problem: The Nirvana Hotel contain 100 rooms. We wish to create a hotel register that can be used to access cach occupant by name with a minimum amount if scarching. We also wish to keep track of all occupants by room number Assignment: Write a program in Java to accomplish the above objective using the following techniques l. Construct a hash table with a load factor near 90%. For this problem use a table of I 14 elements with subscripts ranging from 0 to 113. 2. Resolve collisions by chaining of empty table positions. 3. Maintain a chain of empty table positions. 4. Use an array of tags to access occupants by room number. 5. Maintain necessary counters to compute the following at the end of the run: a. probes per successful b. probes per unsuccessful search c. probes per scarch (overall) search 6. Use the names given in this handout to initially fill up the hotel. (may be in any order desired 7. Use the action requests given in this handout as the action input cards to your program. These cards must be input to your program in the same order they are listed in this hand out. 8. You must submit flowcharts with your program. The logic involved in maintaining the chains in the hash table can be quite tricky, if you write your flowchart first you may save yourself a lot of agony when you begin testing your program. Adames, Winter Abraham, MathewsShah, Syed Fester, kevm Weady , Mark Darid Fields , Janet Adams, Carl Alvarez, Marjorie Alummootil, Tony rac Barreca, Nancy Bennettson, Christine Bristol, Phillip Cardiello, Brian Chung, Darren Concepcion, Diony Cui, Hui Liang David, Bunmi Dilawari, Shonila Ehrlinger, Frederick Famodimu, Gideon Glynn, Debra Inoa, Jose Lam, Shirley Lau, Ka Kin Matos, Fanny Meyer, Richard Nunez, Gregory Richardson, Enerolisa Rodriquez, Dennis aleem, Amir Salzman, Brian Siddiqui, Moudud- Smith, Mellinda Tessema, Yikum Woldmichael, Yodit Cameau, Hans Corbett, Dennis Critchlow, Amenia Diaz, Brendaly Escalante, Martin Fleury, Melinda Ford, Thomas Josefsberg, Richard Kelly, James Langebek, Michele Myrthil, Jean Nasser, Muhammed Nguyen. Linh Niefeld, Tracy Padilla, Karl Scneider, Ross Steiner, Jared Tierney, Jeremy Tsai, James Wallace, Lorna Williams, William Yair, Yeud Atique, Kazi Burke, Grace-Ann Farook, Mohammed Feng, Feng Nian Hong, Robert James, Christopher Lopez, Emmanuel Mathew, Jiji Naseer, Muhammed Resmini, James Rommel, Gerald Frshv, Edd e. Farmer Jim inor, Shar Mehtatubun Jackson, Ltanya Abraham, Mathews Barger, Christopher Farrell, Daniel Hubbard, Kwame Mathew, Jiji Nguyen, Linh John, Susan Kutschera, Thomas Akron, Jennifer Lada, Anna - Arriaza, Esperanza Chin, Li-Ching Chong, Kevin Delva, Edson Hughes, John Makkar, Vibhor Rodriguez, Jessica Sewell, Andrew Thorne, Peter IAG TABLE FULL CODE HASH TABLE KE NAME THIS SLOT ALWAYS ROOM 01 EMPTY, HOLDS ACCESS : TO EMPTY CHAIN Zero ndicates 1HOWARD 0 empty room SINGER 10 JONES HALE JOHNSON 0 0 10 10 DAVIS 0 SMITH 0 12 SIMPLE ARRAYS INDICATING CHAINING AND TAGGING DCL 1 HASH TABLE (0:113). ' Zeros Indicate DCL TAG (100) FIX BIN (15); 2 NAMECHAR (36), 2 ROONM 2 FL 2 BL 2 FULL.BIT (1); FIX BIN (i5)Ends of Chains FIX BIN (15) FIX BIN (15) hash nom to produce kev INSERTIMi key position YES occupiad ?. insert Dan No occupant oreigne YES !in empty lot and chain to key position mpty alot and adjust his chain y poaition hah name to produce ker re and YES No name in the ke position the dvance dow chain add key poaition il nam i found adjust chain YES found in chain adjnat chain around na e position and add thi pos- ition to the empty chain ore reqnes pote: this flowehart baaic ide of the logie involved. There is ueh Dore detail that uat be added. ACTION REQUEST CARDS DESCRIPTION: 1PRDT prints the entire hasb table in ..quance . 2 (ineluding tabl ubaeript). prints room numbers and occupants D Beguence reqnested rooa numbei checks Penon into . hotel, requested roo is 0t evailable, aaign any room available. Also print mesage noting peraons. name and assigned room. eheclo person out of hotel, print mesaage.indicatinig nam and roon nuaber. alo print erro message i peraon i not currently in hotel. locat the roou of an oeeupant, print essag* indicating aa and rooa rber. .print error Dessage if person not D the hote . no^UiReD RERuESTS Fob THis PROGRAM: (follo thi equence) 92 1 58 JOFNSON, CAROL FANVER, after laat print requeat, compat probe per earch requested and print them on your output, Hotel Problem Problem: The Nirvana Hotel contain 100 rooms. We wish to create a hotel register that can be used to access cach occupant by name with a minimum amount if scarching. We also wish to keep track of all occupants by room number Assignment: Write a program in Java to accomplish the above objective using the following techniques l. Construct a hash table with a load factor near 90%. For this problem use a table of I 14 elements with subscripts ranging from 0 to 113. 2. Resolve collisions by chaining of empty table positions. 3. Maintain a chain of empty table positions. 4. Use an array of tags to access occupants by room number. 5. Maintain necessary counters to compute the following at the end of the run: a. probes per successful b. probes per unsuccessful search c. probes per scarch (overall) search 6. Use the names given in this handout to initially fill up the hotel. (may be in any order desired 7. Use the action requests given in this handout as the action input cards to your program. These cards must be input to your program in the same order they are listed in this hand out. 8. You must submit flowcharts with your program. The logic involved in maintaining the chains in the hash table can be quite tricky, if you write your flowchart first you may save yourself a lot of agony when you begin testing your program. Adames, Winter Abraham, MathewsShah, Syed Fester, kevm Weady , Mark Darid Fields , Janet Adams, Carl Alvarez, Marjorie Alummootil, Tony rac Barreca, Nancy Bennettson, Christine Bristol, Phillip Cardiello, Brian Chung, Darren Concepcion, Diony Cui, Hui Liang David, Bunmi Dilawari, Shonila Ehrlinger, Frederick Famodimu, Gideon Glynn, Debra Inoa, Jose Lam, Shirley Lau, Ka Kin Matos, Fanny Meyer, Richard Nunez, Gregory Richardson, Enerolisa Rodriquez, Dennis aleem, Amir Salzman, Brian Siddiqui, Moudud- Smith, Mellinda Tessema, Yikum Woldmichael, Yodit Cameau, Hans Corbett, Dennis Critchlow, Amenia Diaz, Brendaly Escalante, Martin Fleury, Melinda Ford, Thomas Josefsberg, Richard Kelly, James Langebek, Michele Myrthil, Jean Nasser, Muhammed Nguyen. Linh Niefeld, Tracy Padilla, Karl Scneider, Ross Steiner, Jared Tierney, Jeremy Tsai, James Wallace, Lorna Williams, William Yair, Yeud Atique, Kazi Burke, Grace-Ann Farook, Mohammed Feng, Feng Nian Hong, Robert James, Christopher Lopez, Emmanuel Mathew, Jiji Naseer, Muhammed Resmini, James Rommel, Gerald Frshv, Edd e. Farmer Jim inor, Shar Mehtatubun Jackson, Ltanya Abraham, Mathews Barger, Christopher Farrell, Daniel Hubbard, Kwame Mathew, Jiji Nguyen, Linh John, Susan Kutschera, Thomas Akron, Jennifer Lada, Anna - Arriaza, Esperanza Chin, Li-Ching Chong, Kevin Delva, Edson Hughes, John Makkar, Vibhor Rodriguez, Jessica Sewell, Andrew Thorne, Peter IAG TABLE FULL CODE HASH TABLE KE NAME THIS SLOT ALWAYS ROOM 01 EMPTY, HOLDS ACCESS : TO EMPTY CHAIN Zero ndicates 1HOWARD 0 empty room SINGER 10 JONES HALE JOHNSON 0 0 10 10 DAVIS 0 SMITH 0 12 SIMPLE ARRAYS INDICATING CHAINING AND TAGGING DCL 1 HASH TABLE (0:113). ' Zeros Indicate DCL TAG (100) FIX BIN (15); 2 NAMECHAR (36), 2 ROONM 2 FL 2 BL 2 FULL.BIT (1); FIX BIN (i5)Ends of Chains FIX BIN (15) FIX BIN (15) hash nom to produce kev INSERTIMi key position YES occupiad ?. insert Dan No occupant oreigne YES !in empty lot and chain to key position mpty alot and adjust his chain y poaition hah name to produce ker re and YES No name in the ke position the dvance dow chain add key poaition il nam i found adjust chain YES found in chain adjnat chain around na e position and add thi pos- ition to the empty chain ore reqnes pote: this flowehart baaic ide of the logie involved. There is ueh Dore detail that uat be added. ACTION REQUEST CARDS DESCRIPTION: 1PRDT prints the entire hasb table in ..quance . 2 (ineluding tabl ubaeript). prints room numbers and occupants D Beguence reqnested rooa numbei checks Penon into . hotel, requested roo is 0t evailable, aaign any room available. Also print mesage noting peraons. name and assigned room. eheclo person out of hotel, print mesaage.indicatinig nam and roon nuaber. alo print erro message i peraon i not currently in hotel. locat the roou of an oeeupant, print essag* indicating aa and rooa rber. .print error Dessage if person not D the hote . no^UiReD RERuESTS Fob THis PROGRAM: (follo thi equence) 92 1 58 JOFNSON, CAROL FANVER, after laat print requeat, compat probe per earch requested and print them on your output

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions