void modify(char * input, hashTable& table){ stock stock; table.retrieve(input, stock); float newNetAssetValue; char newDate[MAX_LEN]; float newDateReturn; newNetAssetValue = getFloat("\tNew value: "); getString("\tNew date: ", newDate); newDateReturn = getFloat("\tNew return: "); table.modify(input, newNetAssetValue, newDate, newDateReturn); }
void menuoptions(char decider, hashTable & table) { data aData; char key[100]; switch (decider) { case 'd': table.display(); break; case 'a': makeData(table); break; case 'm': table.monitor(); break; case 'e': cout << "Enter the stock ticker you'd like to edit: "; cin.ignore(100, '\n'); cin.get(key, 100, '\n'); table.modify(key); break; case 'r': cout << "Enter the stock ticker you'd like to remove: "; cin.ignore(100, '\n'); cin.get(key, 100, '\n'); table.remove(key); break; case 'f': cout << "Enter the stock ticker you'd like to find: "; cin.ignore(100, '\n'); cin.get(key, 100, '\n'); table.retrieve(key, aData); aData.print(); break; case 'q': cout << "------Program Terminated------"; break; } }