Write a program using STL’s map associative container to store pairs of the form pair<string, double>, where the string values are the surnames of the eight position players for the New York Mets who started the baseball game against the Montreal Expos on September 17, 2000, and for which the corresponding double value is that players batting average:
These values should not be hard-coded in the program. They should be read from the standard input (cin). Of course, you'll want to use files to store your test input cases so that you don't have to type everything in every time you run it. Remember that you can redirect the contents of a file to be cin for a program with the < operator on the command line. For example:
C:\users\bob\[url removed, login to view] < [url removed, login to view]
a. Is it necessary to replace map with multimap?
b. Apply find to this container for “Ventura”.
c. Output the eight pairs in matching columns
d. Erase “Abbott”, 0.274 and replace it with “Alfonso”, 0.325
e. Display all entries in the map.
Được trao cho: