// name: Connor McDowell // date: 2/19/2024 // class: CST116 // reason: homework number 6 #include "Contacts.h" #include using std::cin; using std::cout; using std::endl; int main() { size_t MAX = 3; int O = 1; int t = 0; contact* newContact = new contact[MAX]; while (O == 1) { int c = 0; cout << "1. Enter a contact\n"; cout << "2. Update a contact\n"; cout << "3. print all contacts\n"; cout << "4. Quit\n"; cout << "\nEnter your choice: " << endl; cin >> c; //c = menu(); if (c == 1) { addNew(&newContact[MAX], MAX, t); ++t; cout << t << endl; cout << "enter full length of array" << endl; cin >> t; if (t >= MAX) { contact* doubleContact = new contact[MAX * 2]; for (newContact[t].count = t; t < MAX * 2;) { doubleContact[t] = newContact[t]; } delete[] newContact; newContact = doubleContact; MAX = MAX * 2; } } if (c == 2) { update(&newContact[MAX], MAX); } if (c == 3) { printAll(&newContact[MAX], MAX); } if (c == 4) { O = 0; } } }