From 36c4160b5a2a4734eda79ac04d216f003c4b8368 Mon Sep 17 00:00:00 2001 From: Asahel Date: Mon, 12 Feb 2024 18:03:30 -0800 Subject: Saving work --- Homework5/Contacts.cpp | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'Homework5/Contacts.cpp') diff --git a/Homework5/Contacts.cpp b/Homework5/Contacts.cpp index e69de29..acde949 100644 --- a/Homework5/Contacts.cpp +++ b/Homework5/Contacts.cpp @@ -0,0 +1,41 @@ +#include "Contacts.h" +#include + +using std::cout; +using std::endl; +using std::cin; + +Contact InputNewContact() { + Contact newContact = {}; + + cout << "Name: "; + cin >> newContact.Name; + + cout << "Email: "; + cin >> newContact.Email; + + cout << "Street Address: "; + cin >> newContact.StreetAddress; + + cout << "City: "; + cin >> newContact.City; + + cout << "State: "; + cin >> newContact.State; + + cout << "Zip: "; + cin >> newContact.Zip; + + return newContact; +} + +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; + } +} \ No newline at end of file -- cgit v1.2.3