CS 202 Fall 2013  >  In-Class Challenge for Thursday, November 7, 2013

CS 202 Fall 2013
In-Class Challenge for Thursday, November 7, 2013

Our Goal

We wish to write a program that keeps track of an associative dataset in a map (or unordered_map). We can add or alter a value in the dataset, and we can print out the whole dataset.

What to Do

  1. Write a program assocdata.cpp that keeps track of an associative dataset with string keys and int values. It begins with an empty dataset and then repeatedly does the following.
    • Print a menu and get a user selection. The user can set the value associated with a key, print the value (if any) associated with a key, print the whole dataset, or exit.
    • Act on the user’s selection.

Other Stuff


CS 202 Fall 2013: In-Class Challenge for Thursday, November 7, 2013 / Updated: 7 Nov 2013 / Glenn G. Chappell