Skip to content

feat: implement food registry using structs, enums, hashmap and custo…#22

Open
observerr411 wants to merge 1 commit into
thebuidl-grid:mainfrom
observerr411:assignment
Open

feat: implement food registry using structs, enums, hashmap and custo…#22
observerr411 wants to merge 1 commit into
thebuidl-grid:mainfrom
observerr411:assignment

Conversation

@observerr411

Copy link
Copy Markdown
Collaborator

Added Food struct to store food details (name, price, calories)
Created FoodType enum to represent food categories (Snack, Swallow, Rice, Beans)
Implemented RegistryError enum for error handling (FoodAlreadyExists, FoodNotFound)
Built FoodRegistry struct using HashMap to store food records
Added functions to add and retrieve food items from the registry
Implemented Result-based error handling for safe operations
Demonstrated usage in main function with example food entries

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant