-
Notifications
You must be signed in to change notification settings - Fork 1
/
Source.cpp
83 lines (73 loc) · 2.1 KB
/
Source.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// Source.cpp
// Author: Siraj Qazi
// Templatized Linked List v3.1
// Dated: September 16th, 2018 10:01PM
// Main() File
#include <iostream>
#include <string>
#include "doubly_templatized_linked_list.h"
using namespace std;
void launchTemplatizedLinkedList(void);
int main()
{
system("cls");
cout << "\n Please set your command-window font size to 32 for best experience."
<< "\n\n Click Window Icon > Properties > Font > 32 > OK"
<< "\n Maximize window to Full Screen afterwards."
<< "\n\n Press any key once you're done. ";
_getch();
launchTemplatizedLinkedList(); // Launch the Program
}
void launchTemplatizedLinkedList()
{
system("cls");
system("color 0a");
cout << "\n ################# DYNAMIC TEMPLATIZED LINKED-LIST IMPLEMENTATION IN C++ ################\n\n";
cout << " ~ Version 3.1 ~\n"
<< " @sqazi \n\n"
<< " ########################################################################################\n";
cout << "\n Welcome. Choose your linked-list data type: \n";
cout << "\n Press 1-5 to select option:\n\n"
<< "\t\t 1 > Integer\t\t\t\t(int)\n"
<< "\t\t 2 > Decimal\t\t\t\t(float)\n"
<< "\t\t 3 > Single Character\t\t\t(char)\n"
<< "\t\t 4 > Sequence of characters\t\t(string)\n"
<< "\t\t 5 > Boolean variable\t\t\t(bool)\n ";
char c = _getch();
if (c == '1')
{
Node<int>::LinkedList L_int;
L_int.operationMode = c;
L_int.commenceOperation();
}
else if (c == '2')
{
Node<float>::LinkedList L_float;
L_float.operationMode = c;
L_float.commenceOperation();
}
else if (c == '3')
{
Node<char>::LinkedList L_char;
L_char.operationMode = c;
L_char.commenceOperation();
}
else if (c == '4')
{
Node<std::string>::LinkedList L_str;
L_str.operationMode = c;
L_str.commenceOperation();
}
else if (c == '5')
{
Node<bool>::LinkedList L_bool;
L_bool.operationMode = c;
L_bool.commenceOperation();
}
else
{
cout << "\n Please press 1-5. ";
_getch();
launchTemplatizedLinkedList();
}
}