-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain (3).cpp
66 lines (62 loc) · 1.62 KB
/
main (3).cpp
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
// ---------------------------------------------------------------------------
// Name: Christelle Mbemba
// Course-Section: CS255-02
// Assignment: Project 8
// Date due: 04/09/2023
// Description: implementation of an address class with overloaded operators for comparison and output.
// ---------------------------------------------------------------------------
#include <iostream>
#include <fstream>
#include "addressType.h"
#include "linkedList.h"
using namespace std;
int main()
{
int count = 0;
ifstream inFile;
inFile.open("addresses.txt");
linkedListType<addressType> atLL;
addressType atTemp;
string temp, f, l, sA, c, s, zst;
int z;
while(getline(inFile, temp))
{
switch(count)
{
case 0:
f = temp;
break;
case 1:
l = temp;
break;
case 2:
sA = temp;
break;
case 3:
c = temp;
break;
case 4:
s = temp;
break;
case 5:
zst = temp;
z = stoi(zst);
atTemp.setAll(f, l, sA, c, s, z);
atLL.insert(atTemp);
break;
}
count = (count+1) % 6;
}
atLL.print();
atLL.sort();
cout<<endl<<endl;
cout<<"SORTED LIST"<<endl;
atLL.print();
addressType atDel;
atDel.setAll("Daniel", "Ray", "1234 Woodlow Dr SE", "Huntsville", "AL", 32523);
atLL.deleteNode(atDel);
cout<<endl<<endl;
cout<<"UPDATED LIST"<<endl;
atLL.print();
return 0;
}