diff options
| author | rPatrickWarner <[email protected]> | 2024-03-11 20:44:18 -0700 |
|---|---|---|
| committer | rPatrickWarner <[email protected]> | 2024-03-11 20:44:18 -0700 |
| commit | 7447eb346f8029d1f972e605c1b1ae0917836bb1 (patch) | |
| tree | 7de35f759150f15ac401633f9d8c7e4ba7a0f14b /Homework8/MyStructures/MenuHelper.hpp | |
| parent | some changes (diff) | |
| download | homework-8-reecepwarner-7447eb346f8029d1f972e605c1b1ae0917836bb1.tar.xz homework-8-reecepwarner-7447eb346f8029d1f972e605c1b1ae0917836bb1.zip | |
all of the functions are complete
Diffstat (limited to 'Homework8/MyStructures/MenuHelper.hpp')
| -rw-r--r-- | Homework8/MyStructures/MenuHelper.hpp | 32 |
1 files changed, 7 insertions, 25 deletions
diff --git a/Homework8/MyStructures/MenuHelper.hpp b/Homework8/MyStructures/MenuHelper.hpp index bb5a70d..858f6e3 100644 --- a/Homework8/MyStructures/MenuHelper.hpp +++ b/Homework8/MyStructures/MenuHelper.hpp @@ -14,19 +14,15 @@ namespace MyStructures int InputInt(const char* prompt); - void PrintContact(ContactList<Contact>& contacts); - Contact NewContact(); - void PrintContact(ContactList<Contact>& contacts); - bool OverWriteCharArray(); void MainMenu() { char Options = '\0'; - - + size_t i = 0; + ContactList<Contact> AddressBook(3); do { std::cout << "Welcome to the contacts menu\n" @@ -38,13 +34,15 @@ namespace MyStructures switch (Options) { case('1'): - + AddressBook.Append(InputContact()); break; case('2'): - //PrintContact(contacts); + AddressBook.PrintList(); break; case('3'): - //contacts.DeleteContact("Which contact would you like to delete?", contacts); + cout << "Which contact would you like to delete?:"; + cin >> i; + AddressBook.DeleteContact(i); break; case('4'): std::cout << "Thank you, have a great day!" << std::endl; @@ -60,7 +58,6 @@ namespace MyStructures Contact InputContact() { - Contact newContact; newContact.SetFirstName(PromptCharInput("What is your first name?", 101)); @@ -71,25 +68,10 @@ namespace MyStructures newContact.SetCity(PromptCharInput("What is your city?: ", 101)); newContact.SetZip(InputInt("What is your zip?")); - return newContact; - - } - void PrintContact(ContactList<Contact>& contacts) - { - contacts.PrintList(); - } - - inline bool OverWriteCharArray() - { - return false; - } - - - Contact NewContact() { Contact newContact; |