Some of the attributes of a state in the United States are its name, capital, area, year
Question:
Some of the attributes of a state in the United States are its name, capital, area, year of admission to the union, and the order of admission to the union.
Task A: Implement (define the methods) the class stateData (inline with the class definition, stateData.h, to keep track of the information for a state. The stateData class includes appropriate functions to manipulate the state’s data, such as the functionssetStateInfo, getStateInfo, and so on. Also, overload the relational operators to compare two states by their name. For easy input and output, overload the stream operators, << and>>.
Task B: In the main driver we are using the class hashT as described in the section, ‘‘Hashing: Implementation Using Quadratic Probing,’’ which uses quadratic probing to resolve collision, to create a hash table to keep track of each state’s information. Use the state’s name as the key to determine the hash address. You may assume that a state’s name is a string of no more than 15 characters.
Complete the provided main driver to test your program that searches for and removes certain states from the hash table. Some function you will need to call. See the comments of the main driver file for specifics.
Add and use the following hash function, to the main driver, to determine the hash address of an item:
int hashFunc(string name)
{
int i, sum;
int len;
i = 0;
sum = 0;
len = name.length();
for (int k = 0; k < 15 - len; k++)
name = name + ' ';
for (int k = 0; k < 5; k++)
{
sum = sum + static_cast(name[i]) * 128 * 128 +
static_cast(name[i + 1]) * 128 +
static_cast(name[i + 2]);
i = i + 3;
}
return sum % HTSize;
}
----------------------
Download and use the hashT, and the starter files for statedata and main Driver found in this
https://www.mediafire.com/?a4bdip7n7po1a3n
----------------------
Cost management a strategic approach
ISBN: 978-0073526942
5th edition
Authors: Edward J. Blocher, David E. Stout, Gary Cokins