Problem 1: HashMap Basics
Task 1: Using Hashmap to organize data
It’s a party! A customer has a big birthday party for more than 20 people! Everyone has their own order. To keep the mass order organized, you decide to create a hashmap of String
s. The birthday girl’s name is Isabella, but her name is lost in the list. Can you figure out what Isabella ordered?
- Do you remember the hashmap methods?
- Look at example order below!
// Example of current hashmap
HashMap<String, String> order = new HashMap<String, String>();
//key, value
order.put("Justin", "Sprite");
order.put("George", "Coke");
order.put("Sam", "Fanta");
order.put("Eva", "Coke");
order.put("Olivia", "Coke");
...