Question: Use Hashtable ( no need to implement your own code, you can use Java Hashtable ) to store information about shelters. 2 . Implement methods
Use Hashtable no need to implement your own code, you can use Java Hashtable to
store information about shelters.
Implement methods to add, update, and search for shelter information.
Ensure the main method does not exceed lines of code.
Implement the project correctly.
Add meaningful identifiers, consistent indentation, explanatory comments, and properly formatted output.
B Description
You are tasked with developing a Homeless Shelter Management System. This system will help
manage information about shelters, allowing details to be added, updated, and searched.
System Requirements
Shelter Information Management:
Make a class Shelter with attributes: name, location, capacity,
availableBeds, and contactInfo.
Use a Hashtable to store Shelter objects with the shelter name as the key.
Adding Shelter Information:
Implement a method to add shelter information to the system. If a shelter already
exists, update its information.
Updating Shelter Information:
Implement a method to update the available beds in a shelter. Ensure that the
available beds do not exceed the capacity.
Searching for Shelter Information:
Implement a method to search for shelters by name. Return the shelter details if
found; otherwise, indicate that the shelter is not available.
User Interface:
Develop a textbased menu interface to interact with the system. The interface
should include options to add shelter information, update available beds, search
for shelters, and exit the program.
Sample Program Flow
Start the program and display the menu.
Select an option Add Shelter, Update Available Beds, Search Shelter, Exit
Perform the selected action and display the result.
Repeat until the user chooses to exit.
Sample Output:
Welcome to the Homeless Shelter Management System
Add Shelter
Update Available Beds
Search Shelter
Exit
Enter your choice:
Enter shelter name: Hope Shelter
Enter location: Hope St
Enter capacity:
Enter available beds:
Enter contact info:
Shelter added successfully!
Add Shelter
Update Available Beds
Search Shelter
Exit
Enter your choice:
Enter shelter name: Hope Shelter
Enter available beds:
Available beds updated successfully!
Add Shelter
Update Available Beds
Search Shelter
Exit
Enter your choice:
Enter shelter name: Hope Shelter
Shelter: Hope Shelter, Location: Hope St Capacity: Available Beds:
Contact Info:
Add Shelter
Update Available Beds
Search Shelter
Exit
Enter your choice:
Goodbye!
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
