#include #include #include "hashT.h" using namespace std; class stateData {     friend ostream& operator<<(ostream&, const stateData&); // used to print state data on screen     friend istream& operator>>(istream&, stateData&); // used to load data from file public:     // setting values to the class object     void setStateInfo(string sName, string sCapital,                        double stateArea, int yAdm, int oAdm);     // retrieving data with call-by reference from the class object     void getStateInfo(string& sName, string& sCapital,                        double& stateArea, int& yAdm, int& oAdm);     string getStateName(); //return state name     string getStateCapitalName(); //return state capital's name     double getArea(); //return state's area     int getYearOfAdmission();//return state's admision year     int getOrderOfAdmission();//return state's order of admission     //print stateName, stateCapital,stateArea, yearOfAdmission, and orderOfAdmission     void printInfo();      bool operator==(const stateData& right) const; // overloading      bool operator!=(const stateData& right) const;// overloading  private:     string stateName;     string stateCapital;     double stateArea;     int yearOfAdmission;     int orderOfAdmission; };     StateDataImp.Cpp // Write function descriptions in the file (\textbf{stateDataImp.cpp }) by referncing the function declarations listed in the class file \textbf{stateData.h}. // used to print state data on screen ostream& operator<<(ostream& os, const stateData& st) {          os << "State: " << st.stateName << "(" << st.stateCapital << ")";     os << " [" << st.stateArea << "] ";     os << "(" << st.yearOfAdmission << ", " << st.orderOfAdmission << ")";     return os; } // used to load data from file istream& operator>>(istream& is, stateData& st) {     char ch;     getline(is, st.stateName);     getline(is, st.stateCapital);     is >> st.stateArea >> st.yearOfAdmission        >> st.orderOfAdmission;     is.get(ch);    return is; } inputdata.txt New Hampshire Concord 9304 1788 9 Massachusetts Boston 8257 1788 6 Vermont Montpelier 9609 1791 14 Rhode Island Providence 1214 1790 13 Connecticut Hartford 5009 1788 5 Maine Augusta 33215 1820 23 New York Albany 49576 1788 11 Pennsylvania Harrisburg 45333 1787 2 Delaware Dover 2057 1787 1 Maryland Annapolis 10577 1788 7 Washington Olympia 68192 1889 42 Oregon Salem  96981 1859 33 Virginia Richmond 40815 1788 10 North Carolina Raleigh 52586 1789 12 South Carolina Columbia 31055 1788 8 Georgia Atlanta 58876 1788 4 New Jersey Trenton 7836 1787 3 Hawaii Honolulu 6450 1959 50 Iowa Des Moines 56290 1846 29 Florida Tallahassee 58560 1845 27 Tennessee Nashville 42244 1796 16 Michigan Lansing 58216 1837 26 Ohio Columbus 41222 1803 17 Wyoming Cheyenne 97914 1890 44 Colorado Denver 104247 1876 38 Nebraska Lincoln 77227 1867 37 Wisconsin Madison 56154 1848 30 South Dakota Pierre 77047 1889 39 Alabama Montgomery 51609 1819 22 Mississippi Jackson 47716 1817 20 Louisiana Baton Rouge 48523 1812 18 Arkansas Little Rock 53104 1836 25 Missouri Jefferson City 69686 1821 24 Kentuckey Frankfort 40395 1792 15 Minnesota Saint Paul 84068 1858 32 North Dakota Bismark 70665 1889 41 Kansas Topeka 82264 1861 34 Oklahoma Oklahoma City 69919 1907 46 Texas Austin 267338 1845 28 New Mexico Santa Fe 121666 1912 47 Arizona Phoenix 113909 1912 48 Utah Sakt Lake City 84916 1896 45 Nevada Carson City 110540 1864 36 Idaho Boise 83557 1890 43 West Virginia Charleston 24181 1863 35 California Sacramento 158706 1850 31 Alaska Juneau 586412 1959 49 Indiana Indianapolis 36291 1816 19 Illinois Springfield 56400 1818 21 Montana Helena 147138 1889 41

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

#include <iostream>
#include <string>
#include "hashT.h"

using namespace std;

class stateData
{
    friend ostream& operator<<(ostream&, const stateData&); // used to print state data on screen
    friend istream& operator>>(istream&, stateData&); // used to load data from file

public:
    // setting values to the class object
    void setStateInfo(string sName, string sCapital, 
                      double stateArea, int yAdm, int oAdm);
    // retrieving data with call-by reference from the class object
    void getStateInfo(string& sName, string& sCapital, 
                      double& stateArea, int& yAdm, int& oAdm);

    string getStateName(); //return state name
    string getStateCapitalName(); //return state capital's name
    double getArea(); //return state's area
    int getYearOfAdmission();//return state's admision year
    int getOrderOfAdmission();//return state's order of admission
    //print stateName, stateCapital,stateArea, yearOfAdmission, and orderOfAdmission
    void printInfo(); 

    bool operator==(const stateData& right) const; // overloading 
    bool operator!=(const stateData& right) const;// overloading 

private:
    string stateName;
    string stateCapital;
    double stateArea;
    int yearOfAdmission;
    int orderOfAdmission;
};  

 


StateDataImp.Cpp

// Write function descriptions in the file (\textbf{stateDataImp.cpp }) by referncing the function declarations listed in the class file \textbf{stateData.h}.

// used to print state data on screen
ostream& operator<<(ostream& os, const stateData& st)
{
    
    os << "State: " << st.stateName << "(" << st.stateCapital << ")";
    os << " [" << st.stateArea << "] ";
    os << "(" << st.yearOfAdmission << ", " << st.orderOfAdmission << ")";

    return os;
}

// used to load data from file
istream& operator>>(istream& is, stateData& st)
{
    char ch;
    getline(is, st.stateName);
    getline(is, st.stateCapital);
    is >> st.stateArea >> st.yearOfAdmission
       >> st.orderOfAdmission;
    is.get(ch);

   return is;
}

inputdata.txt

New Hampshire
Concord
9304 1788 9
Massachusetts
Boston
8257 1788 6
Vermont
Montpelier
9609 1791 14
Rhode Island
Providence
1214 1790 13
Connecticut
Hartford
5009 1788 5
Maine
Augusta
33215 1820 23
New York
Albany
49576 1788 11
Pennsylvania
Harrisburg
45333 1787 2
Delaware
Dover
2057 1787 1
Maryland
Annapolis
10577 1788 7
Washington
Olympia
68192 1889 42
Oregon
Salem 
96981 1859 33
Virginia
Richmond
40815 1788 10
North Carolina
Raleigh
52586 1789 12
South Carolina
Columbia
31055 1788 8
Georgia
Atlanta
58876 1788 4
New Jersey
Trenton
7836 1787 3
Hawaii
Honolulu
6450 1959 50
Iowa
Des Moines
56290 1846 29
Florida
Tallahassee
58560 1845 27
Tennessee
Nashville
42244 1796 16
Michigan
Lansing
58216 1837 26
Ohio
Columbus
41222 1803 17
Wyoming
Cheyenne
97914 1890 44
Colorado
Denver
104247 1876 38
Nebraska
Lincoln
77227 1867 37
Wisconsin
Madison
56154 1848 30
South Dakota
Pierre
77047 1889 39
Alabama
Montgomery
51609 1819 22
Mississippi
Jackson
47716 1817 20
Louisiana
Baton Rouge
48523 1812 18
Arkansas
Little Rock
53104 1836 25
Missouri
Jefferson City
69686 1821 24
Kentuckey
Frankfort
40395 1792 15
Minnesota
Saint Paul
84068 1858 32
North Dakota
Bismark
70665 1889 41
Kansas
Topeka
82264 1861 34
Oklahoma
Oklahoma City
69919 1907 46
Texas
Austin
267338 1845 28
New Mexico
Santa Fe
121666 1912 47
Arizona
Phoenix
113909 1912 48
Utah
Sakt Lake City
84916 1896 45
Nevada
Carson City
110540 1864 36
Idaho
Boise
83557 1890 43
West Virginia
Charleston
24181 1863 35
California
Sacramento
158706 1850 31
Alaska
Juneau
586412 1959 49
Indiana
Indianapolis
36291 1816 19
Illinois
Springfield
56400 1818 21
Montana
Helena
147138 1889 41

hashT.H is provided by googling"HashT.h DS Malik" and selecting The Third Option Provided on the  web" it displays as United States Program Git hub"

Please Help ME

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Introduction to Template
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
  • SEE MORE 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