diff options
| author | Yana Blashchishina <[email protected]> | 2024-02-11 16:09:28 -0800 |
|---|---|---|
| committer | Yana Blashchishina <[email protected]> | 2024-02-11 16:09:28 -0800 |
| commit | 564aa3d8dc31ca25088c66225a7b15dc6af655c5 (patch) | |
| tree | f0f5ef2c203f2ec913acf81f8c4b680221f81b3d /Homework5 | |
| parent | void (diff) | |
| download | homework-5-yanablash-564aa3d8dc31ca25088c66225a7b15dc6af655c5.tar.xz homework-5-yanablash-564aa3d8dc31ca25088c66225a7b15dc6af655c5.zip | |
code is angry at me
Diffstat (limited to 'Homework5')
| -rw-r--r-- | Homework5/Homework5/Contacts.h | 4 | ||||
| -rw-r--r-- | Homework5/Homework5/program.cpp | 31 |
2 files changed, 32 insertions, 3 deletions
diff --git a/Homework5/Homework5/Contacts.h b/Homework5/Homework5/Contacts.h index 6508fbd..5e896b2 100644 --- a/Homework5/Homework5/Contacts.h +++ b/Homework5/Homework5/Contacts.h @@ -2,7 +2,7 @@ #define CONTACTS_H -struct Contact { +struct Contacts { char Name[25] = {}; char Email[100] = {}; char StreetAddress[35]{}; @@ -11,6 +11,4 @@ struct Contact { int Zip = 0; }; - - #endif
\ No newline at end of file diff --git a/Homework5/Homework5/program.cpp b/Homework5/Homework5/program.cpp index 6398182..5547664 100644 --- a/Homework5/Homework5/program.cpp +++ b/Homework5/Homework5/program.cpp @@ -14,10 +14,41 @@ using std::cin; using std::endl; int main() { + Contacts contactsManager; + char option; + do { + cout << "Menu Options: " << endl; + cout << "1. Add New Contact" << endl; + cout << "2. Update Contact" << endl; + cout << "3. Print All Contacts" << endl; + cout << "4. Exit" << endl; + cout << "Enter your option : "; + + cin >> option; + switch (option) { + case '1': + contactsManager.AddNewContact(); + break; + + case'2': + contactsManager.UpdateContact(); + break; + + case'3': + contactsManager.PrintAllContacts(); + break; + + default: + cout << "Errrrr. Choose an option" << endl; + + } + + } while (option != '4'); + |