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
- Write a program
assocdata.cpp
that keeps track of an associative dataset withstring
keys andint
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
- You may wish to start with my program
domenu.cpp
.
CS 202 Fall 2013: In-Class Challenge for Thursday, November 7, 2013 /
Updated: 7 Nov 2013 /
Glenn G. Chappell