Summary Files Commits Branches @commit @diff @stats
path: root / Year 1 / Object-oriented Programming / Solutions Sem. 08 / ex3 / source.cpp
diff options
context:
space:
mode:
Commit9829b368ce529df277397e3b465fc536fa65ebfd (patch)
Author
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-04-14 23:53:14 +0300
Committer
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-04-14 23:53:14 +0300
Files502a0f1a061a4177e7117118ba2f3164f993ef63 /Year 1/Object-oriented Programming/Solutions Sem. 08/ex3/source.cpp
uni-projects-9829b368ce529df277397e3b465fc536fa65ebfd.tar
uni-projects-9829b368ce529df277397e3b465fc536fa65ebfd.tar.gz
uni-projects-9829b368ce529df277397e3b465fc536fa65ebfd.zip
Parent27cf6165d0592f842ed667a8da3013489213c2a1 (diff)
Implemented (broken) overall functionality of ex3 of sem 08
1 files changed, 25 insertions, 0 deletions
-rw-r--r--Year 1/Object-oriented Programming/Solutions Sem. 08/ex3/source.cpp25
diff --git a/Year 1/Object-oriented Programming/Solutions Sem. 08/ex3/source.cpp b/Year 1/Object-oriented Programming/Solutions Sem. 08/ex3/source.cpp
new file mode 100644
index 0000000..3a04ba6
--- /dev/null
+++ b/Year 1/Object-oriented Programming/Solutions Sem. 08/ex3/source.cpp
@@ -0,0 +1,25 @@
+#include "WordCollection.h"
+#include <iostream>
+
+int main()
+{
+ WordCollection dict;
+ ((dict *= "Ivan") *= "Petur") *= "Alex";
+ std::cout << dict << std::endl; // {Alex, Ivan, Petur}
+ std::cout << dict["Alex"] << " " << dict["abc"] << std::endl; // 1 0
+
+ WordCollection dict2;
+ ((dict *= "Zebra") *= "Alex");
+ //
+ WordCollection result = dict + dict2;
+ std::cout << result << std::endl; // {Alex, Ivan, Petur, Zebra}
+
+ WordCollection result2 = dict - dict2;
+ std::cout << result2 << std::endl; // {Ivan, Petur}
+
+ result2 *= "NewWOrd";
+ result2 /= "NonExistingWord";
+ std::cout << result2 << std::endl; //{Ivan, NewWOrd, Petur}
+ std::cin >> result2; //въвеждаме "Job"
+ std::cout << result2 << std::endl; //{Ivan, Job, NewWOrd, Petur}
+}