commit fc737a580b46ec275f279045e0d099e054233099 Author: Szymon Wiśniewski Date: Mon Dec 2 14:48:49 2024 +0100 Add folders diff --git a/Zad2/WDI_dom_1.pdf b/Zad2/WDI_dom_1.pdf new file mode 100644 index 0000000..6137fca Binary files /dev/null and b/Zad2/WDI_dom_1.pdf differ diff --git a/Zad3/WDI_dom_2.pdf b/Zad3/WDI_dom_2.pdf new file mode 100644 index 0000000..1aa8061 Binary files /dev/null and b/Zad3/WDI_dom_2.pdf differ diff --git a/Zad4/WDI_dom_4.pdf b/Zad4/WDI_dom_4.pdf new file mode 100644 index 0000000..5129ec7 Binary files /dev/null and b/Zad4/WDI_dom_4.pdf differ diff --git a/Zad4/morseCode.cpp b/Zad4/morseCode.cpp new file mode 100644 index 0000000..d325c57 --- /dev/null +++ b/Zad4/morseCode.cpp @@ -0,0 +1,71 @@ +#include +#include +#include +#include + +using namespace std; + +int main() +{ + string morse[36] = {".-","-...","-.-.","-..",".","..-.","--.","....","..",".---","-.-",".-..","--","-.","---",".--.","--.-",".-.","...","-","..-","...-",".--","-..-","-.--","--..", + ".----","..--","...--","...-",".....","-....","--...","---..","----.","-----"}; + string alpha[36] = {"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","1","2","3","4","5","6","7","8","9","0"}; + int n; + string a, wynik; + while (true) + { + cout << "\nTen program pozwala na tlumaczenie zdan z kodu morse'a lub na kod morse'a\n Nacisnij 1 jesli chcesz tlumaczyc z kodu morse'a lub 2 jesli chcesz tlumaczyc na kod morse'a.\n Nacisnij 3 jesli chcesz zamknac program\n" << endl; + cin >> n; + switch (n) + { + case 1: + a = ""; + wynik = ""; + cout << "\nWpisz jeden znak kodu morse'a a nastepnie kliknij enter, aby wstawic spacje wpisz / i wcisnij enter.\nAby skonczyc przekazywanie i zaczac tlumaczenie nacisnij * i enter." << endl; + cin >> a; + while (a != "*") + { + for (int i = 0; i < 36; i++) + { + if (morse[i] == a) + { + wynik += alpha[i]; + } + } + if (a == "/") + { + wynik += " "; + } + cin >> a; + } + cout << wynik << endl;; + break; + + case 2: + a = ""; + wynik = ""; + cout << "Wpisz mala litere lub cyfre ktora bedzie tlumaczona na kod morse'a i wcisnij enter, aby zrobic spacje wpisz / i wcisnij enter.\nW przetlumaczonym zdaniu litery beda oddzielone spacja a slowa dwoma tabulatorami.\nAby skonczyc i zaczac tlumaczenie wcisnij * i enter." << endl; + cin >> a; + while (a != "*") + { + for (int i = 0; i < 36; i++) + { + if (alpha[i] == a) + { + wynik += morse[i]+ " "; + } + } + if (a == "/") + { + wynik += " "; + } + cin >> a; + } + cout << wynik << endl; + break; + case 3: + exit(3); + } + } +} + diff --git a/Zad5/WDI_dom_5.pdf b/Zad5/WDI_dom_5.pdf new file mode 100644 index 0000000..e448caf Binary files /dev/null and b/Zad5/WDI_dom_5.pdf differ diff --git a/Zad6/WDI_dom_6.pdf b/Zad6/WDI_dom_6.pdf new file mode 100644 index 0000000..0f09bc3 Binary files /dev/null and b/Zad6/WDI_dom_6.pdf differ diff --git a/Zad7/WDI_dom_7.pdf b/Zad7/WDI_dom_7.pdf new file mode 100644 index 0000000..e80d717 Binary files /dev/null and b/Zad7/WDI_dom_7.pdf differ