Question: Part I. Create a C + + class named City that encapsulates the fields shown in this data file. USCities - 1 0 0 -

Part I. Create a C++ class named City that encapsulates the fields shown in this data file. USCities-100-1.csv Download USCities-100-1.csv A specification file (the .h file) and an implementation file (the .cpp file) are required. All setters and getters are required. The default constructor is required - initialize all string attributes to "" and all numeric attributes to 0 A second constructor that will have one parameter - one line of data read from the data file. This constructor will parse/tokenize the line into the appropriate attributes. Part II. Overloaded operators required: == this will compare two City objects for equivalence of all attributes != this will compare two City objects for difference in at least one of the attributes < this will compare the population of two City objects > this will compare the population of two City objects +=(int)- to increase the population (increase the population only - don't alter the other numeric attributes with this operator)<< this will display the current state of the object in a neat formatted way using cout<<, you may consider using a horizontal display of information because later you will be asked to generate reports in table format, to add commas to numeric output you may use this: printWithCommas.cpp Download printWithCommas.cpp >> this will allow the user to enter an city into the data structure using cin>>

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!