Dog
+* Objects of type Dog
: Max
, Milo
, Coco
, ...
+
+___
+
+### What is a class?
+
+A class is a type.
+
+
+A class in C++ is slightly different from an actual class 🙂 In C++ (or object-oriented programming in general) a class defines the characteristics of an object:
+
+
+* what properties will this object have (fields)
+* what methods of operation will it have (methods, functions)
+
+___
+
+### Questions
+
+* what properties could a computer
object have?
+* what methods could the computer
have?
+
+```cpp
+class Computer {
+ // fields
+ Processor processor_;
+ Drive drive_;
+ Motherboard motherboard_;
+ GraphicsCard graphics_card_;
+ Memory memory_;
+
+ // methods
+ void run();
+ void restart();
+ void shutdown();
+};
+```
+
+
+___
+
+## Composition, aggregation
+
+Nothing prevents one object from being composed of other objects. In this way, we make the structure of our code more understandable.
+
+Containing one object within another is called composition or aggregation. These are not synonyms, they are two slightly different types of object containment, but that doesn't matter at the moment. For example with a computer:
+
+
+```cpp
+class Computer {
+ Processor processor_;
+ Drive drive_;
+ Motherboard motherboard_;
+ GraphicsCard graphics_card_;
+ Memory memory_;
+ // ...
+};
+```
+
+
+A computer consists (is composed of) of a processor, drive, motherboard, graphics card, memory.
+
+
+___
+
+
+## Class diagram - composition, aggregation
+
+
+
+* Composition: A car contains exactly 1 Carburetor. The carburetor is part of exactly one car. Without a car, the carburetor does nothing, so it cannot function without it.
+* Aggregation: Pond can contain any number (0 .. *) of Ducks. The duck may be in only one pond at a time or in none (0..1). The duck can live outside the pond.
+
+[Class diagram - wikipedia](https://en.wikipedia.org/wiki/Class_diagram)
+
+
+___
+
+## Q&A
diff --git a/module1/presentation_oop_intro.md b/module1/00_intro.pl.md
similarity index 96%
rename from module1/presentation_oop_intro.md
rename to module1/00_intro.pl.md
index ce6672d85..52f02ae8a 100644
--- a/module1/presentation_oop_intro.md
+++ b/module1/00_intro.pl.md
@@ -50,7 +50,7 @@ ___
Klasa to typ.
-Klasa w C++ nieco różni się od rzeczywistej klasy :) W C++ (czy też programowaniu obiektowym ogólnie) klasa określa cechy obiektu:
+Klasa w C++ nieco różni się od rzeczywistej klasy 🙂 W C++ (czy też programowaniu obiektowym ogólnie) klasa określa cechy obiektu:
* jakie właściwości będzie miał ten obiekt (pola)
diff --git a/module1/01_access_modifiers.en.md b/module1/01_access_modifiers.en.md
new file mode 100644
index 000000000..1a310ebde
--- /dev/null
+++ b/module1/01_access_modifiers.en.md
@@ -0,0 +1,62 @@
+
+
+# Object oriented programming
+
+## Access modifiers
+
+
+
+
+
+___
+
+## `class` vs `struct`
+
+To represent types outside classes (`class`) we still have structures (`struct`).
+
+
+The main difference is that all structure elements - its methods and variables - are public by default. By contrast, in the class they are private by default.
+
+
+Word `private` means that we only have access to these fields inside the class. We cannot appeal to them outside of this class. Word `public` means that we have external access to the data.
+
+
+___
+
+## Access modifiers
+
+### `private` vs `public`
+
+```cpp
+class Computer {
+private:
+ void restart();
+};
+
+Computer computer;
+computer.restart(); // Forbidden, restart is a private member
+```
+
+
+```cpp
+class Computer {
+public:
+ void restart();
+};
+
+Computer computer;
+computer.restart(); // Ok
+```
+
+
+___
+
+### Access modifier `protected`
+
+There is one more access modifier in C++ - `protected`.
+
+We will tell about it when we explain what inheritance is.
+
+___
+
+## Q&A
diff --git a/module1/presentation_access_modifiers.md b/module1/01_access_modifiers.pl.md
similarity index 97%
rename from module1/presentation_access_modifiers.md
rename to module1/01_access_modifiers.pl.md
index 372a30740..d1a8f36e3 100644
--- a/module1/presentation_access_modifiers.md
+++ b/module1/01_access_modifiers.pl.md
@@ -51,7 +51,7 @@ computer.restart(); // Ok
___
-## Modyfikator dostępu `protected`
+### Modyfikator dostępu `protected`
Istnieje jeszcze jeden modyfikator dostępu w C++ - `protected`.
diff --git a/module1/02_ctor_dtor.en.md b/module1/02_ctor_dtor.en.md
new file mode 100644
index 000000000..61f0debc4
--- /dev/null
+++ b/module1/02_ctor_dtor.en.md
@@ -0,0 +1,146 @@
+
+
+# Object oriented programming
+
+## Constructors and destructors
+
+
+
+
+
+___
+
+## Constructor
+
+The class constructor is a recipe that determines how our class should look at the time of creation.
+
+
+This is a special function with the same name as the class.
+
+
+We can provide the constructor with all the information we need, e.g. the size of the array, the date of purchase, etc.
+
+
+```cpp
+class Ship {
+public:
+ Ship(const std::string& name, size_t capacity); // constructor, c-tor
+
+private:
+ std::string name_;
+ const size_t capacity_;
+};
+```
+
+
+___
+
+## Constructors
+
+A class can have multiple constructors. They must differ in the parameter list because they are function overloads.
+
+
+A class may have, among others argumentless (default) constructor e.g. `Ship()` which is automatically generated if it has no other constructor defined.
+
+
+```cpp
+class Ship {
+ // default c-tor Ship() is generated automatically, no need to write it
+ std::string name_;
+ const size_t capacity_;
+};
+```
+
+
+___
+
+## Constructor initialization list
+
+We can use the initialization list to initialize the data in the constructor.
+
+
+The initialization list is written after the constructor signature after the colon.
+
+
+```cpp
+class Processor {
+public:
+ Processor(unsigned clock, size_t cores)
+ : clock_(clock), cores_(cores) // init-list
+ {}
+
+ // the effect of above constructor is the same as below
+ // Processor(unsigned clock, size_t cores) {
+ // clock_ = clock;
+ // cores_ = cores;
+ // }
+
+private:
+ unsigned clock_;
+ size_t cores_;
+}
+```
+
+
+___
+
+## Constructor delegation
+
+An element of the initialization list can even be another constructor of our class.
+
+
+```cpp
+class Ship {
+public:
+ Ship(const std::string& name, size_t capacity, size_t crew):
+ name_(name), capacity_(capacity), crew_(crew)
+ {}
+
+ Ship(const std::string& name, size_t capacity):
+ Ship(name, capacity, 0)
+ {}
+
+private:
+ std::string name_;
+ const size_t capacity_;
+ size_t crew_;
+};
+```
+
+
+___
+
+
+## Destructor
+
+Destructor is a special function to clean our class.
+
+
+Must be named the same as the class, but preceded by a tilde character `~`.
+
+
+We can use it if we want to trigger specific actions while destroying the object, e.g. registering this fact in the log, etc.
+
+
+```cpp
+class Ship {
+public:
+ Ship(const std::string& name, size_t capacity, size_t crew):
+ name_(name), capacity_(capacity), crew_(crew)
+ {}
+
+ ~Ship() { // d-tor, destruktor
+ std::cout << "Ship destroyed\n";
+ }
+
+private:
+ std::string name_;
+ const size_t capacity_;
+ size_t crew_;
+};
+```
+
+
+___
+
+## Q&A
diff --git a/module1/presentation_ctor_dtor.md b/module1/02_ctor_dtor.pl.md
similarity index 100%
rename from module1/presentation_ctor_dtor.md
rename to module1/02_ctor_dtor.pl.md
diff --git a/module1/03_hermetization.en.md b/module1/03_hermetization.en.md
new file mode 100644
index 000000000..263185f6d
--- /dev/null
+++ b/module1/03_hermetization.en.md
@@ -0,0 +1,49 @@
+
+
+# Object oriented programming
+
+## Hermetization
+
+
+
+
+
+___
+
+## Hermetization
+
+In order to protect our object against unwanted modifications, we can make the so-called hermetization or encapsulation.
+
+
+It consists in placing all properties (fields) in the private section and enabling their modification by public functions.
+
+
+___
+
+## setters and getters
+
+The simplest functions that allow modifications are the so-called setters.
+
+
+A setter is a function that assigns a given value to a specific variable.
+
+
+```cpp
+void setName(const std::string& name) { name_ = name; }
+```
+
+
+Since the data is private, it is also not possible to read it, so we do it through getters.
+
+
+```cpp
+std::string getName() const { return name_ }
+```
+
+
+Of course, we don't always need to allow all variables to be modified, just as not all variables can have getters. The choice is up to the developer.
+
+
+___
+
+## Q&A
diff --git a/module1/presentation_hermetization.md b/module1/03_hermetization.pl.md
similarity index 100%
rename from module1/presentation_hermetization.md
rename to module1/03_hermetization.pl.md
diff --git a/module1/04_tasks.en.md b/module1/04_tasks.en.md
new file mode 100644
index 000000000..6226fbbf9
--- /dev/null
+++ b/module1/04_tasks.en.md
@@ -0,0 +1,66 @@
+
+
+# Object oriented programming
+
+## Exercises
+
+
+
+
+
+___
+
+## Exercise 1
+
+Write a class `Ship` which will store the ship's data:
+
+* `id_`
+* `name_`
+* `speed_`
+* `maxCrew_`
+* `capacity_`
+
+The data should be private, and access to it should be through getters.
+
+___
+
+## Exercise 2
+
+Add to class `Ship` constructors that will accept the appropriate data. There should be 3 constructors:
+
+* The first one takes no arguments -> `id_` for such an object should be `-1`
+* The second accepting all data
+* Third takes `id`, `speed` and `maxCrew` (try to use the second constructor when writing the third one)
+
+Additionally, add a method `void set_name(const std::string&)`.
+
+___
+
+## Exercise 3
+
+Add to class `Ship`:
+
+* variable `size_t crew_` specifying the current number of the ship's crew
+* `Ship& operator+=(const int)` that will add the crew to the ship
+* `Ship& operator-=(const int)` that will subtract it.
+
+___
+
+## Exercise 4
+
+Create a class `Cargo`. It is supposed to represent 1 type of good on the ship. It will have 3 fields:
+
+* `name_` - product name
+* `amount_` - amount of stock
+* `basePrice_` - the base price of the good
+
+Then write in class `Cargo`:
+
+* `Cargo& operator+=(const size_t)` that will add the specified quantity of the goods
+* `Cargo& operator-=(const size_t)` which will subtract the given quantity of goods
+
+Also consider how you will store goods on board.
+
+___
+
+## Q&A
diff --git a/module1/presentation_tasks.md b/module1/04_tasks.pl.md
similarity index 100%
rename from module1/presentation_tasks.md
rename to module1/04_tasks.pl.md
diff --git a/module1/05_homework.en.md b/module1/05_homework.en.md
new file mode 100644
index 000000000..2c6627e44
--- /dev/null
+++ b/module1/05_homework.en.md
@@ -0,0 +1,146 @@
+
+
+# Object oriented programming
+
+## Summary
+
+
+
+
+
+___
+
+## What do you remember from today?
+
+### Write as many keywords as possible in the chat
+
+
+1. class
+2. objects
+3. fields, properties
+4. methods, functions of the class
+5. access modifiers - public
, private
+6. constructors
+7. destructors
+8. hermetization
+9. getters
+10. setters
+
+___
+
+### Pre-work
+
+* Read and watch videos on inheritance and polymorphism
+
+___
+
+## Group project
+
+Use the code written during the class. You can also use the code in the [solutions](solutions) directory
+
+Group project. Recommended groups of 5 (4-6 are also ok).
+
+Make a Fork of this repo and the whole project is going to be in the [shm](../shm) directory
+
+Collaborate on one fork with a branch or Pull Requests from your own forks.
+
+___
+
+## Organization of work
+
+To divide tasks and track your status, you can use the [Projects on GitHub](https://github.com/coders-school/object-oriented-programming/projects) tab. You can configure it from the Automated kanban with reviews template.
+
+### Planning
+
+Begin with planning where you create cards for each task in the To Do column. It's best to convert them to Issues. Thanks to this, you can assign to tasks and write comments in them. Also write for each task how many days of work you estimate it for. After finishing planning, please send a link to the `#planning` channel to your project board on GitHub.
+
+### Daily
+
+Update your tasks as you work. Synchronize at the same time every day and talk about the problems.
+
+___
+
+### Code Review
+
+Each task delivery must be preceded by a Code Review by another person from the team (or preferably several) to maintain consistency and cooperation.
+
+### Completion
+
+This project will be developed even further. We expect that, regardless of the number of completed tasks, you will do a Pull Request before June 28 (in Scrum, the team decides how many tasks they can do for a specific date).
+
+___
+
+### Punctation
+
+* Each delivered task is worth 5 points
+* 20 points for all 8 tasks delivered before 6/28/2020 (Sunday) by 11:59 PM
+* no bonus points for delivering only part of tasks before 28/06.
+* 6 points for group work for each person in the group.
+
+___
+
+## Task 1
+
+In class `Cargo` write the comparison operator (`operator==`), which will check if the goods are the same.
+
+___
+
+## Exercise 2
+
+Add getters to the class `Cargo` and an appropriate constructor that will fill all the fields of this class.
+
+___
+
+## Exercise 3
+
+Write a class `Island` which will hold the variable `Coordinates position_` and the appropriate getter.
+
+`Coordinates` class has to determine the coordinates on the map. Write it as well. It should take 2 parameters in the constructor `positionX`, `positionY` and the comparison operator.
+
+
+___
+
+## Task 4
+
+Write a class `Map` that will have `std::vectorpublic
, private
6. konstruktory
7. destruktory
8. hermetyzacja
diff --git a/module1/index.en.html b/module1/index.en.html
new file mode 100644
index 000000000..99ce19bb6
--- /dev/null
+++ b/module1/index.en.html
@@ -0,0 +1,151 @@
+
+
+
+
+
+
+ void eat() override
+* void sleep() override
+* void makeSound() override
+* void fly() override
+* void swim() override
+
+Overwriting such methods means that we can change their implementations.
+
+
+___
+
+## `override`
+
+```cpp
+class Soundable {
+public:
+ virtual void makeSound() = 0;
+};
+```
+
+```cpp
+class Goose : public Soundable {
+public:
+ void makeSound() override { std::cout << "Honk! Honk!"; }
+};
+```
+
+```cpp
+class Hen : public Soundable {
+public:
+ void makeSound() override { std::cout << "Cluck! Cluck!"; }
+};
+```
+
+```cpp
+class Duck : public Soundable {
+public:
+ void makeSound() override { std::cout << "Quack! Quack!"; }
+};
+```
+
+___
+
+## Common base class
+
+Because the common parent of all classes is the class `Soundable` we can store type pointers in a container `Soundable`.
+
+```cpp
+std::vectorvoid eat() override
+* void sleep() override
+* void makeSound() override
+* void fly() override
+* void swim() override
+
+Overwriting such methods means that we can change their implementations.
+
+
+___
+
+## `override`
+
+```cpp
+class Soundable {
+public:
+ virtual void makeSound() = 0;
+};
+```
+
+```cpp
+class Goose : public Soundable {
+public:
+ void makeSound() override { std::cout << "Honk! Honk!"; }
+};
+```
+
+```cpp
+class Hen : public Soundable {
+public:
+ void makeSound() override { std::cout << "Cluck! Cluck!"; }
+};
+```
+
+```cpp
+class Duck : public Soundable {
+public:
+ void makeSound() override { std::cout << "Quack! Quack!"; }
+};
+```
+
+___
+
+## Common base class
+
+Because the common parent of all classes is the class `Soundable` we can store type pointers in a container `Soundable`.
+
+```cpp
+std::vectorstd::vector
na cppreference.com
+ * Część prywatna (implementacja) jest nieznana
+* Projektowanie zorientowane obiektowo (OOD - Object Oriented Design)
+
+> Make interfaces easy to use correctly and hard to use incorrectly
+>
+> \ - \ - Scott Meyers, [Efektywne C ++](https://blog.ycshao.com/2012/11/23/effective-c-item-18-make-interfaces-easy-to-use-correctly-and-hard-to-use-incorrectly/)
+
+
+___
+
+## Zły przykład interfejsu
+
+```c++
+// A date class which is easy to use but also easy to use wrong.
+class Date {
+ public:
+ Date(int month, int day, int year);
+ ...
+};
+
+// Both are ok, but some european programmer may use it wrong,
+// because european time format is dd/mm/yyyy instead of mm/dd/yyyy.
+Date d(3, 4, 2000);
+Date d(4, 3, 2000);
+```
diff --git a/module4/encapsulation.md b/module4/02_encapsulation.en.md
similarity index 100%
rename from module4/encapsulation.md
rename to module4/02_encapsulation.en.md
diff --git a/module4/02_encapsulation.pl.md b/module4/02_encapsulation.pl.md
new file mode 100644
index 000000000..ae4f27533
--- /dev/null
+++ b/module4/02_encapsulation.pl.md
@@ -0,0 +1,14 @@
+
+
+# Enkapsulacja
+
+___
+
+## Enkapsulacja
+
+* Specyfikatory dostępu
+ * public
- struct
domyślna
+ * protected
+ * private
- class
domyślna
+* Settery i gettery
+* Nienazwane przestrzenie nazw
diff --git a/module4/inheritance.md b/module4/03_inheritance.en.md
similarity index 100%
rename from module4/inheritance.md
rename to module4/03_inheritance.en.md
diff --git a/module4/03_inheritance.pl.md b/module4/03_inheritance.pl.md
new file mode 100644
index 000000000..9894df0f6
--- /dev/null
+++ b/module4/03_inheritance.pl.md
@@ -0,0 +1,27 @@
+
+
+# Dziedziczenie
+
+___
+
+## Dziedziczenie
+
+* Porządek wywoływania konstruktorów i destruktorów
+ * Konstruktory - najpierw klasa bazowa, potem pochodna
+ * ideone.com
+* Problem diamentowy
+ * dziedziczenie wirtualne
+* dziedziczenie class
od struct
jest ...
+ * private
+* dziedziczenie struct
od class
jest ...
+ * public
+
+___
+
+## Modyfikatory dostępu do dziedziczenia
+
+| | public
| protected
| private
|
+| : ------------------------: | : ------------------------------------------------- ------: | : ------------------------------------------------- ------: | : ------------------------------------------------- ----: |
+| **public
** | publiczny | chroniony | prywatny |
+| **protected
** | chroniony | chroniony | prywatny |
+| **private
** | prywatny | prywatny | prywatny |
diff --git a/module4/polymorphism.md b/module4/04_polymorphism.en.md
similarity index 100%
rename from module4/polymorphism.md
rename to module4/04_polymorphism.en.md
diff --git a/module4/04_polymorphism.pl.md b/module4/04_polymorphism.pl.md
new file mode 100644
index 000000000..4bcdc3886
--- /dev/null
+++ b/module4/04_polymorphism.pl.md
@@ -0,0 +1,15 @@
+
+
+# Polimorfizm
+
+___
+
+## Polimorfizm
+
+* Funkcje wirtualne
+* funkcje czysto wirtualne (=0
)
+* Klasy abstrakcyjne
+ * mają co najmniej jedną funkcję czysto wirtualną
+* vtable
i vptr
+ * implementacja polimorfizmu
+ * Konstruktor klasy pochodnej przesłania rekordy klasy bazowej w vtable
diff --git a/module4/exercise_cars.md b/module4/05_exercise_cars.en.md
similarity index 100%
rename from module4/exercise_cars.md
rename to module4/05_exercise_cars.en.md
diff --git a/module4/05_exercise_cars.pl.md b/module4/05_exercise_cars.pl.md
new file mode 100644
index 000000000..69ef42ab1
--- /dev/null
+++ b/module4/05_exercise_cars.pl.md
@@ -0,0 +1,19 @@
+
+
+# Zadanie
+
+___
+
+## Samochody
+
+1. Zaprojektuj odpowiednią abstrakcję (interfejsy)
+2. Zastosuj dziedziczenie
+3. Napraw hermetyzację
+4. Użyj polimorfizmu, aby przedstawić każdy typ samochodu za pomocą jednego wskaźnika
+5. Napraw problem diamentowy
+6. Napraw potencjalne wycieki pamięci
+7. Pomyśl o sposobie przechowywania silników w samochodach. Czy powinny być przechowywane przez wartość, referencję czy wskaźnik (jaki rodzaj wskaźnika)?
+8. Czy ten kod można przetestować?
+
+### [Wyświetl zadanie w repozytorium](https://github.com/coders-school/Cars.git)
+
diff --git a/module4/post_work.md b/module4/06_post_work.en.md
similarity index 100%
rename from module4/post_work.md
rename to module4/06_post_work.en.md
diff --git a/module4/06_post_work.pl.md b/module4/06_post_work.pl.md
new file mode 100644
index 000000000..d181940cc
--- /dev/null
+++ b/module4/06_post_work.pl.md
@@ -0,0 +1,17 @@
+
+
+# Post-work
+
+___
+
+## Post-work
+
+Możesz pracować w grupach lub indywidualnie. Zrób forka repozytorium Cars i Pull Requesta po zakończeniu.
+
+1. (4 XP) Utwórz wyjątek InvalidGear
. Należy go rzucić, gdy ktoś próbuje np. zmienić bieg z 5 na wsteczny. Powinien dziedziczyć z jednego z wyjątków STL
+2. (2 XP za każdą poprawkę) Napraw interfejsy, aby były łatwe w użyciu, poprawne i trudne w użyciu nieprawidłowo (np. accelerate(-999)
)
+3. (10 XP - opcjonalnie) Napisz odpowiednie testy jednostkowe do tego kodu
+4. Przeczytaj jeden z poniższych artykułów. Przyda się na następną lekcję
+
+ * SOLID czyli dobre praktyki w programowaniu obiektowym (po polsku)
+ * S.O.L.I.D: The First 5 Principles of Object Oriented Design (po angielsku)
diff --git a/module4/index.html b/module4/index.en.html
similarity index 88%
rename from module4/index.html
rename to module4/index.en.html
index 2b02a08c5..f24101b92 100644
--- a/module4/index.html
+++ b/module4/index.en.html
@@ -69,25 +69,25 @@