Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

More Books

Students also viewed these Programming questions