diff options
| author | Miles-Cell <[email protected]> | 2024-02-12 12:14:24 -0800 |
|---|---|---|
| committer | Miles-Cell <[email protected]> | 2024-02-12 12:14:24 -0800 |
| commit | c9a7dd63a9e874828692c3fc5f64cc84ce0ae7a5 (patch) | |
| tree | 3e4e6dfe17649461a8ee1d685af3f531f31b8901 | |
| parent | Updated code. Assignment not completed yet. (diff) | |
| download | homework-5-miles-cell-c9a7dd63a9e874828692c3fc5f64cc84ce0ae7a5.tar.xz homework-5-miles-cell-c9a7dd63a9e874828692c3fc5f64cc84ce0ae7a5.zip | |
Exercise complete.
| -rw-r--r-- | Homework 5/Homework 5/Contacts.cpp | 17 | ||||
| -rw-r--r-- | Homework 5/Homework 5/program.cpp | 14 |
2 files changed, 24 insertions, 7 deletions
diff --git a/Homework 5/Homework 5/Contacts.cpp b/Homework 5/Homework 5/Contacts.cpp index e93358b..284eeee 100644 --- a/Homework 5/Homework 5/Contacts.cpp +++ b/Homework 5/Homework 5/Contacts.cpp @@ -35,11 +35,16 @@ void PrintContacts(Contact(&contacts)[10]) { for (auto &x : contacts) { - cout << "Name: " << x.Name << endl; - cout << "Email: " << x.Email << endl; - cout << "Street Address: " << x.StreetAddress << endl; - cout << "City: " << x.City << endl; - cout << "State: " << x.State << endl; - cout << "Zip: " << x.Zip << endl; + cout << "\nName: " << x.Name << endl; + + cout << "\nEmail: " << x.Email << endl; + + cout << "\nStreet Address: " << x.StreetAddress << endl; + + cout << "\nCity: " << x.City << endl; + + cout << "\nState: " << x.State << endl; + + cout << "\nZip: " << x.Zip << endl; } } diff --git a/Homework 5/Homework 5/program.cpp b/Homework 5/Homework 5/program.cpp index f488216..b2388e3 100644 --- a/Homework 5/Homework 5/program.cpp +++ b/Homework 5/Homework 5/program.cpp @@ -6,12 +6,14 @@ #include <iostream> +#include "Contacts.h" #include <cstdlib> using std::cout; using std::cin; using std::endl; + const int MAX = 10; @@ -35,20 +37,30 @@ int main() switch (c) { case 'A': - //do stuff = New contact added to array + contacts[numberOfContacts] = InputNewContacts(); + numberOfContacts++; break; + case 'B': //Pick a contact, then update with new info; + //Print the contacts with element # + //Prompt for user to input element # + //Pass that Contact to a function to update break; + case 'C': //Print the contacts + //Loop through the contacts, printing real contacts. break; + case 'x': //exit break; + default: cout << "\nThat was a bad input\n"; } } while (c != 'x'); return 0; } + |