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.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

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<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.

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<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 state Population and output the pair.
Ex: If the input is:
21044
the output is:
Maryland: 6079602
Transcribed Image Text: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<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 state Population and output the pair. Ex: If the input is: 21044 the output is: Maryland: 6079602
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps with 4 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education