diff options
| author | rPatrickWarner <[email protected]> | 2024-03-12 12:41:34 -0700 |
|---|---|---|
| committer | rPatrickWarner <[email protected]> | 2024-03-12 12:41:34 -0700 |
| commit | d05c67247509afd6e8672b22229a7e9ba2399f7c (patch) | |
| tree | 71f929b863dff11c5407b300da96a6d66d84e29d /Homework8/MyStructures/MenuHelper.hpp | |
| parent | all of the functions are complete (diff) | |
| download | homework-8-reecepwarner-main.tar.xz homework-8-reecepwarner-main.zip | |
Diffstat (limited to 'Homework8/MyStructures/MenuHelper.hpp')
| -rw-r--r-- | Homework8/MyStructures/MenuHelper.hpp | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/Homework8/MyStructures/MenuHelper.hpp b/Homework8/MyStructures/MenuHelper.hpp index 858f6e3..6fa263b 100644 --- a/Homework8/MyStructures/MenuHelper.hpp +++ b/Homework8/MyStructures/MenuHelper.hpp @@ -14,9 +14,6 @@ namespace MyStructures int InputInt(const char* prompt); - Contact NewContact(); - - void MainMenu() { @@ -40,13 +37,10 @@ namespace MyStructures AddressBook.PrintList(); break; case('3'): - cout << "Which contact would you like to delete?:"; - cin >> i; - AddressBook.DeleteContact(i); + AddressBook.DeleteContact(InputInt("Which Contact Would you like to delete?")-1); break; case('4'): std::cout << "Thank you, have a great day!" << std::endl; - break; default: std::cout << "Invalid Input, Try Again!" << std::endl; @@ -72,14 +66,6 @@ namespace MyStructures } - Contact NewContact() - { - Contact newContact; - - return newContact; - } - - char* PromptCharInput(const char* prompt, long long maxlen) { @@ -100,6 +86,7 @@ namespace MyStructures return input; } + int InputInt(const char* prompt) { std::cout << prompt << std::endl; @@ -122,9 +109,6 @@ namespace MyStructures return data; } - - - }; |