aboutsummaryrefslogtreecommitdiff
path: root/Homework5/Contacts.cpp
blob: acde949d616f992be5c4c119cd8cf04ffe60e57b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include "Contacts.h"
#include <iostream>

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;
	}
}