Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
8 changed files
with
172 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
How did the programmer die in the shower? | ||
He read the shampoo bottle instructions: Lather. Rinse. Repeat. | ||
|
||
Eight bytes walk into a bar. The bartender asks, "Can I get you anything?" | ||
"Yeah," reply the bytes. "Make us a double." | ||
|
||
Two bytes meet. The first byte asks, “Are you ill?” | ||
The second byte replies, “No, just feeling a bit off.” | ||
|
||
How many programmers does it take to change a light bulb? | ||
None – It’s a hardware problem. | ||
|
||
Why do programmers always mix up Halloween and Christmas? | ||
Because Oct 31 equals Dec 25. | ||
|
||
There are only 10 kinds of people in this world. | ||
Those who know binary and those who don’t. | ||
|
||
Knock, knock. | ||
Who’s there? | ||
Very long pause…. | ||
Java. | ||
|
||
Programming is like sex: | ||
One mistake and you have to support it for the rest of your life. | ||
|
||
A man is smoking a cigarette. | ||
His friend becomes irritated "Can’t you see the warning on the cigarette pack?" | ||
"Smoking is hazardous to your health!" | ||
The man replies, "I'm a programmer". | ||
"We don’t worry about warnings; we only worry about errors". | ||
|
||
One hundred little bugs in the code | ||
One hundred little bugs. | ||
Fix a bug, compile the code, | ||
Two hundred little bugs in the code. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#include <iostream> | ||
using namespace std; | ||
|
||
class MyClass | ||
{ | ||
public: | ||
int someVariable; | ||
|
||
void some_function() | ||
{ | ||
// do something | ||
} | ||
}; | ||
|
||
int main() | ||
{ | ||
// creating an instance of the class | ||
MyClass anInstance; | ||
|
||
// using an attribute from the instance | ||
anInstance.someVariable = 42; | ||
|
||
// using a function from the instance | ||
anInstance.some_function(); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#include <iostream> | ||
using namespace std; | ||
|
||
class MyClass | ||
{ | ||
public: | ||
int someVariable; | ||
|
||
MyClass() | ||
{ | ||
someVariable = 42; | ||
} | ||
}; | ||
|
||
class MyClassB | ||
{ | ||
public: | ||
int someVariable; | ||
const float someConst; | ||
|
||
MyClassB() : someConst(1.23f) | ||
{ | ||
someVariable = 42; | ||
} | ||
}; | ||
|
||
int main() | ||
{ | ||
// creating an instance of the class | ||
MyClass anInstance; | ||
|
||
// using an attribute from the instance | ||
anInstance.someVariable = 42; | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#include <iostream> | ||
using namespace std; | ||
|
||
class MyClass | ||
{ | ||
private: | ||
int somePrivateVariable; | ||
|
||
int some_private_method() | ||
{ | ||
return somePrivateVariable; | ||
} | ||
|
||
public: | ||
int somePublicVariable; | ||
|
||
int some_public_method() | ||
{ | ||
return somePrivateVariable; | ||
} | ||
|
||
MyClass() | ||
{ | ||
/* constructor is a member of MyClass | ||
so has access to private attributes */ | ||
somePublicVariable = 42; | ||
somePrivateVariable = 69; | ||
|
||
// and methods | ||
some_private_method(); | ||
} | ||
}; | ||
|
||
int main() | ||
{ | ||
// creating an instance of the class | ||
MyClass anInstance; | ||
|
||
// can access public attributes/methods | ||
anInstance.somePublicVariable = 99; | ||
anInstance.some_public_method(); | ||
|
||
// no access to private outside of class | ||
// WONT COMPILE | ||
anInstance.somePrivateVariable = 99; | ||
// WONT COMPILE | ||
anInstance.some_private_method(); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#include <iostream> | ||
using namespace std; | ||
|
||
#include "lec_sep_concerns.h" | ||
|
||
int main() | ||
{ | ||
JokeStore js; | ||
js.load( "Lecture/jokes.txt" ); | ||
|
||
cout << js.random() << endl; | ||
|
||
return 0; | ||
} |
Submodule helper
updated
from 02d26f to 564131