13.5 LAB: Zip code and population (class templates) Define a class StatePair with two template types (T1 and T2), constructors, mutators, accessors, and a PrintInfo() method. Three vectors have been pre-filled with StatePair data in main(): vector> zipCodeState: ZIP code - state abbreviation pairs vector> abbrevState: state abbreviation - state name pairs vector> statePopulation: state name - population pairs Complete main() to use an input ZIP code to retrieve the correct state abbreviation from the vector zipCodeState. Then use the state abbreviation to retrieve the state name from the vector abbrevState. Lastly, use the state name to retrieve the correct state name/population pair from the vector statePopulation and output the pair. Ex: If the input is: 21044 the output is: Maryland: 6079602 The assignment is to find main.cpp and StatePair.h In C++ please. Very Urgent. Your help is very much appreciated.
13.5 LAB: Zip code and population (class templates)
Define a class StatePair with two template types (T1 and T2), constructors, mutators, accessors, and a PrintInfo() method. Three
- vector<StatePair <int, string>> zipCodeState: ZIP code - state abbreviation pairs
- vector<StatePair<string, string>> abbrevState: state abbreviation - state name pairs
- vector<StatePair<string, int>> statePopulation: state name - population pairs
Complete main() to use an input ZIP code to retrieve the correct state abbreviation from the vector zipCodeState. Then use the state abbreviation to retrieve the state name from the vector abbrevState. Lastly, use the state name to retrieve the correct state name/population pair from the vector statePopulation and output the pair.
Ex: If the input is:
21044
the output is:
Maryland: 6079602
The assignment is to find main.cpp and StatePair.h
In C++ please. Very Urgent. Your help is very much appreciated.
Trending now
This is a popular solution!
Step by step
Solved in 5 steps with 4 images