Question: make a program that uses an STLmapto store data for all the zip codes in Texas (Each US Post Office has a different ZIP Code).

make a program that uses an STLmapto store data for all the zip codes in Texas (Each US Post Office has a different ZIP Code).

make a class for storing the zip, city, and county for a Post Office. The class will need both a default constructor and a constructor with a parameter list. The class should provide a member function that returns a string containing the zip, county, and city data (HINT: You can use the += operator to build up your string).

In the main program, make a map with a string key and your class as the value. For each line in the text file, make an object of your class, and then add it to the map. For your convenience, the providedparseZipCode function takes a string and returns a vector of strings (zip, then county, then city). Use the ZIP code as the key, and the object as the value.

Make sure to close the input file when all lines have been read, and objects have been added to the map.

Prompt the user for a zip code, and then display the information for that zip code. If not found, inform the user.

Make sure to clear the map and release any dynamic memory before ending the program.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!