Skip to content

Commit 6321f3a

Browse files
committed
PDF generated
1 parent 9b9ee67 commit 6321f3a

File tree

3 files changed

+59
-3
lines changed

3 files changed

+59
-3
lines changed

module4/cake.cpp

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#include <iostream>
2+
3+
using namespace std;
4+
5+
class Chocolate
6+
{
7+
public:
8+
Chocolate() {
9+
cout << "Chocolate ctor" << endl;
10+
}
11+
~Chocolate() {
12+
cout << "Chocolate dtor" << endl;
13+
}
14+
};
15+
16+
class ChocolateCake
17+
{
18+
public:
19+
ChocolateCake() {
20+
cout << "ChocolateCake ctor" << endl;
21+
}
22+
~ChocolateCake() {
23+
cout << "ChocolateCake dtor" << endl;
24+
}
25+
private:
26+
Chocolate chocolate;
27+
};
28+
29+
class Candles
30+
{
31+
public:
32+
Candles() {
33+
cout << "Candles ctor" << endl;
34+
}
35+
~Candles() {
36+
cout << "Candles dtor" << endl;
37+
}
38+
};
39+
40+
class BirthdayCake : public ChocolateCake
41+
{
42+
public:
43+
BirthdayCake() {
44+
cout << "BirthdayCake ctor" << endl;
45+
}
46+
~BirthdayCake() {
47+
cout << "BirthdayCake dtor" << endl;
48+
}
49+
private:
50+
Candles candles;
51+
};
52+
53+
int main(int argc, char *argv[]) {
54+
BirthdayCake birthdayCake;
55+
return 0;
56+
}

module4/oop4.pdf

316 KB
Binary file not shown.

module4/post_work.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ ___
88

99
You can work in groups or individually. Fork the Cars repo and submit a Pull Request after you have finished.
1010

11-
1. <!-- .element: class="fragment fade-in" --> Create <code>InvalidGear</code> exception. It should be thrown when someone tries eg. change a gear from 5 to R. It should inherit from one of STL exceptions
12-
2. <!-- .element: class="fragment fade-in" --> Fix interfaces to be easy to use correctly and hard to use incorrectly (like <code>accelerate(-999)</code>)
13-
3. <!-- .element: class="fragment fade-in" --> (Optional) Write a proper unit tests to this code
11+
1. <!-- .element: class="fragment fade-in" --> (4 XP) Create <code>InvalidGear</code> exception. It should be thrown when someone tries eg. change a gear from 5 to R. It should inherit from one of STL exceptions
12+
2. <!-- .element: class="fragment fade-in" --> (2 XP per fix) Fix interfaces to be easy to use correctly and hard to use incorrectly (like <code>accelerate(-999)</code>)
13+
3. <!-- .element: class="fragment fade-in" --> (10 XP - optional) Write a proper unit tests to this code
1414
4. <!-- .element: class="fragment fade-in" --> Read one of below articles. It will be useful for the next lesson
1515

1616
* <!-- .element: class="fragment fade-in" --> <a href="https://www.samouczekprogramisty.pl/solid-czyli-dobre-praktyki-w-programowaniu-obiektowym/">SOLID czyli dobre praktyki w programowaniu obiektowym</a> (in Polish)

0 commit comments

Comments
 (0)