Do the following exercise from the book. Follow the instructions for all assignments (one link up) and any specific additional instructions for each problem.
Ch. 8, Programming Problems 2, pg. 264
Name the program giftlist.cpp. Make sure the following requirements are met.
- Program must compile and run.
- All inputs are strings.
- Only do the nice list, not the naughty list.
- User will enter names until empty string denoting no more names.
- Each name will be followed by one or more gifts.
- After names entered display contents of the name list and each gift list.
Remember to upload all files before submitting.
giftlist.cpp
Example run of program
name for nice list: greg
add gifts for greg
gift: legos
gift: cookie
gift:
name for nice list: bob
add gifts for bob
gift: monopoly
gift: candy cane
gift:
name for nice list: alice
add gifts for alice
gift: dress
gift:
name for nice list: tim
add gifts for tim
gift: superman comic
gift: car
gift: pony
gift:
name for nice list:
The list contains
greg legos cookie
bob monopoly candy cane
alice dress
tim superman comic car pony
Textbook:
Data Abstraction and Problem Solving with C++, Frank M. Carrano, ISBN 978-0-13-446397-1
Reviews
There are no reviews yet.