Add folders

This commit is contained in:
Szymon Wiśniewski 2024-12-02 14:48:49 +01:00
commit fc737a580b
7 changed files with 71 additions and 0 deletions

BIN
Zad2/WDI_dom_1.pdf Normal file

Binary file not shown.

BIN
Zad3/WDI_dom_2.pdf Normal file

Binary file not shown.

BIN
Zad4/WDI_dom_4.pdf Normal file

Binary file not shown.

71
Zad4/morseCode.cpp Normal file
View File

@ -0,0 +1,71 @@
#include <iostream>
#include <string>
#include <cstring>
#include <stdlib.h>
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);
}
}
}

BIN
Zad5/WDI_dom_5.pdf Normal file

Binary file not shown.

BIN
Zad6/WDI_dom_6.pdf Normal file

Binary file not shown.

BIN
Zad7/WDI_dom_7.pdf Normal file

Binary file not shown.