-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontact.hpp
30 lines (25 loc) · 948 Bytes
/
contact.hpp
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
#ifndef CONTACT_HPP
#define CONTACT_HPP
#include <iostream>
#include <string>
class Contact {
friend std::ostream& operator<<(std::ostream& out, const Contact& contact) {
out << "Contact ID: " << contact.id << "\n";
out << "First name: " << contact.firstName << "\n";
out << "Last name: " << contact.lastName << "\n";
out << "Address: " << contact.address << "\n";
out << "Age: " << contact.age << "\n";
return out;
}
private:
std::string id;
std::string firstName;
std::string lastName;
std::string address;
int age;
public:
Contact() : id("null"), firstName("unknown"), lastName("unknown"), address("unknown"), age(-1) {};
Contact(const std::string id, const std::string firstName, const std::string lastName, const std::string address, int age) : id(id), firstName(firstName), lastName(lastName), address(address), age(age) {};
~Contact() {};
};
#endif