Project: Plan the Family's Museum Day

The Adeyemi family’s museum day is approaching. Over this course, your planning script has read the family’s picks, asked the museum’s slow old kiosk about one artwork at a time, and fetched one real record from the Art Institute of Chicago. Each piece works on its own, but the family still doesn’t have a plan they can carry around the museum.

In this project, you’ll put those pieces together into one script that turns everyone’s picks into a plan grouped by gallery, then replaces one stand-in lookup with a real request. You’ll build it in graded steps, and you’ve met every piece before.

Understand What the Family Needs From the Plan

The museum is big, and Grandma Bisi doesn’t want to walk past the same room three times. So the family wants a plan that sends them to each gallery once and lists every pick that hangs there. Each person’s picks are still in picks.txt, which you’ve worked with since From Callbacks to Promises:

Language: Text Filename: picks.txt
Tolu: 28560, 111628
Grandma Bisi: 27992
Folake: 6565, 20684
Tunde: 16568

Each line holds one person’s name and the IDs of the artworks they picked. The kiosk knows each artwork’s title and the ID of the gallery it hangs in, and a second lookup turns that ID into the gallery’s name, such as "Gallery 241, second floor". For Tolu and Grandma Bisi alone, the plan would send the family to Gallery 240 for A Sunday on La Grande Jatte, Gallery 241 for The Bedroom, and Gallery 262 for Nighthawks.

Not every pick can be planned, though. Tunde’s pick, 16568, isn’t on view, and nobody wants to spend the afternoon looking for it. The project’s stand-in kiosk also knows Folake’s picks: American Gothic in Gallery 263 and Paris Street; Rainy Day in Gallery 201, which is closed today.

Locked learning resources

Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Already a member? Sign-In

Locked learning resources

The full lesson is for members only. Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Already a member? Sign-In

Become a Member to join the conversation.