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 Strings. The birthday girl’s name is Isabella, but her name is lost in the list. Can you figure out what Isabella ordered?

  1. Do you remember the hashmap methods?
  2. 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");
...

Launch Replit


You did it!
Workshop completed!