aboutsummaryrefslogtreecommitdiff
path: root/Project1/main.cpp
blob: 9d22cd8a2a346ad6aea1ec371433ee02e2c60710 (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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
// author: Connor McDowell
// date: 3/8/2024
// class: CST116 at OIT
// reason: refactoring address book program that used .h and .cpp files with classes into a similar program using .hpp files (assignment 8)
#include "Contact.hpp"
#include "ContactList.hpp"
#include <iostream>

using std::cin;
using std::cout;
using std::endl;

using namespace myStructures;

int main()
{

	contact<int> contact00;
	contact00.Set_firstName("Jimb");
	contact00.Set_lastName("Bo");
	contact00.Set_email("[email protected]");
	contact00.Set_streetAddress("Jimbbo Street");
	contact00.Set_city("Lazy Town");
	contact00.Set_state("LT");
	contact00.Set_zip(696969);

	contact<int> contact01;
	contact01.Set_firstName("Tim");
	contact01.Set_lastName("Bo");
	contact01.Set_email("[email protected]");
	contact01.Set_streetAddress("Immothy Way");
	contact01.Set_city("Lazy town");
	contact01.Set_state("LT");
	contact01.Set_zip(42069);

	contact<int> contact02;
	contact02.Set_firstName("Rim");
	contact02.Set_lastName("Bo");
	contact02.Set_email("[email protected]");
	contact02.Set_streetAddress("Rim Road");
	contact02.Set_city("Lazy Town");
	contact02.Set_state("LT");
	contact02.Set_zip(55555);

	contact<int> contact03;
	contact03.Set_firstName("Bimb");
	contact03.Set_lastName("Bo");
	contact03.Set_email("[email protected]");
	contact03.Set_streetAddress("Normal Street");
	contact03.Set_city("Lazy Town");
	contact03.Set_state("LT");
	contact03.Set_zip(77677);

	ContactList<contact<int>> addressBook;

	addressBook.Append(contact00);

	addressBook.Print();

	return 0;
}


// contact list class below, holding for later.

//template <class CList>
//class ContactList
//{
//public:
//    ContactList() = default;
//    ContactList(size_t size); //Creates contact list of this size
//    ContactList(const CList* contacts, const size_t& length); //Makes a copy of another contact list
//    ~ContactList();
//
//    ContactList(const ContactList& copy); //deep copy constructor
//    ContactList& operator=(const ContactList& rhs); //deep copy assignment
//
//    ContactList(ContactList&& move); //reference(move) constructor
//    ContactList& operator=(ContactList&& rhs); //reference(move) assignment
//
//private:
//    CList* contacts_{ nullptr };
//    size_t length_{ 0 };
//    size_t size_{ 0 };
//
//    CList* AllocateContactList(const size_t& size);
//};