-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
62 lines (62 loc) · 1.9 KB
/
Copy pathmain.cpp
File metadata and controls
62 lines (62 loc) · 1.9 KB
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
#include <iostream>
#include "child.h"
#include "list342.h"
using namespace std;
int main() {
Child c1("Angie", "Ham", 7), c2("Pradnya", "Dhala", 8),
c3("Bill", "Vollmann", 13), c4("Cesar", "Ruiz", 6);
Child c5("Piqi", "Tangi", 7), c6("Russell", "Wilson", 13),
c7("Hank", "Aaron", 3), c8("Madison", "Fife", 7);
Child c9("Miles", "Davis", 65), c10("John", "Zorn", 4), c11;
List342<Child> class1, class2, soccer, chess;
int a = 1, b = -1, c = 13;
class1.Insert(&c1);
class1.Insert(&c2);
class1.Insert(&c3);
class1.Insert(&c4);
class1.Insert(&c5);
class1.Insert(&c6);
class1.Insert(&c5);
cout << "class1: " << class1 << endl;
if (!class1.Insert(&c1)) {
cout << "ERROR::: Duplicate" << endl;
}
class2.Insert(&c4);
class2.Insert(&c5);
class2.Insert(&c6);
class2.Insert(&c7);
class2.Insert(&c10);
cout << "Class2: " << class2 << endl;
class1.Merge(class2);
class2.Merge(class1);
class1.Merge(class2);
class1.Merge(class1);
cout << "class1 and 2 Merged: " << class1 << endl;
class1.Remove(c4, c11);
class1.Remove(c5, c11);
class1.Remove(c11, c11);
if (class1.Remove(c1, c11)) {
cout << "Removed from class1, student " << c11 << endl;
}
cout << "class1: " << class1 << endl;
soccer.Insert(&c6);
soccer.Insert(&c4);
soccer.Insert(&c9);
cout << "soccer: " << soccer << endl;
soccer += class1;
cout << "soccer += class1 : " << soccer << endl;
List342<Child> football = soccer;
if (football == soccer) {
cout << "football: " << football << endl;
}
if (football.Peek(c6, c11)) {
cout << c11 << " is on the football team" << endl;
}
soccer.DeleteList();
List342<int> numbers;
numbers.Insert(&a);
numbers.Insert(&b);
numbers.Insert(&c);
cout << "These are the numbers: " << numbers << endl;
numbers.DeleteList();
}