OOP Archives
Assignments
Assignment 1 - Word Search (Getting back in the grove.)
Assignment 1 - Calendar (Getting back in the grove.)
Assignment 1 - Dice (Getting back in the grove.)
Assignment 1 - Connect 4 (Getting back in the grove.)
Assignment 1 - Maze (Getting back in the grove.)
Assignment 2 - Auto Mileage
Assignment 2 - Savings Account
Assignment 2 - Strings Part 1
Assignment 2 - Rational
Assignment 3 - Strings Part 2
Assignment 3 - Date
Assignment 3 - Friendship (Dog & Owner)
Assignment 3 - Huge Integer
Assignment 4 - String Iterator - String Part3
Assignment 4 - Rational Operator Overloading
Assignment 5 - String Operator Overloading - Strings Part 4
Assignment 5 - Radio Alarm Clock
Assignment 7 - Inheritance
Assignment 7 - Polymorphism 2d Shapes
Shapes Programming Assignment
Assignment 7 - Java Rational
Assignment 8 - Polymorphism
Assignment 8 - Exception Handling
Assignment 8 - Templates
Assignment 8 - Othello
Assignment 9 - Java Superheros
Assignment 9 - Java Connect 4
OOP Examples
C++
#define Macros vs. Inline
Char Pointers
Command Line Arguments
Directives
Dynamic And Static Binding
Inheritance
Inheritance (When are type casts needed?)
Function Templates
New And Delete
Order of construction (Inheritance / Composite Classes)
The Penguin can not fly problem
Function Pointer Example
Polymorphism
Returning A Reference
Static Variable in a function
STL_Example.CPP
Streaming (Geting input of any data type)
String data-type example
Template Functions
Vector_Deque.cpp
Virtual Inheritance
Assignment by default memberwise copy:
Memberwise.cpp |
Shallow.h |
Deep.h |
Deep.cpp
Const:
Metal.h |
Metal.cpp |
CONSTEXAMPLE.CPP |
const_cast
Constructors:
Standard |
Conversion |
Conversion 2 |
Order of construction (Global, Function Level and Static Objects) |
Order of construction (Composite Classes) |
Copy Constructor Tip
Dog class (C++, C#, Java):
[Dog.h |
Dog.cpp |
Assignment2.cpp]
[CDog.cs |
Assignment2.cs ]
[Dog.java |
Assignment2.java]
Exception Handling:
ExceptionHandling.cpp |
Throw Makes a Copy.cpp
Friend (function, class):
[FriendFunction.cpp |
CheckingAccount.h |
CheckingAccount.cpp]
[FriendClass.cpp |
A.h |
B.h]
Multiple Inheritance:
Example diagram |
Main.cpp |
AbstractBaseE.H |
AbstractBaseE.H |
BaseA.H |
BaseB.H |
BaseC.H |
DerivedA.H |
DerivedB.H |
DerivedC.H |
DerivedD.H |
DerivedE.H |
VirtualBaseD.H
Namespacing:
Declaring A Namespace |
Specify Namespace at each use |
Using declarations |
Using directives |
No Name Spacing (Old Method, No longer works)
Operator Overloading:
Example 1:
Main.cpp |
Time.cpp |
Time.h
Example #2 |
The funtion operator: () |
Enums
Rational example:
Assignment4.cpp |
Rational.h |
Rational.cpp
Runtime:
Introduction |
RTTI With Inheritance
Static Data Members:
Main.cpp |
Arkansan.h |
Arkansan.cpp
String Stream Extraction (unknown string length):
Method 1 |
Method 2
Template (Sorted List):
SortedList.h |
TestType.h |
TestType.cpp |
TestSortedList.cpp
Templates With Friends:
Test.cpp |
NormalOldClass.cpp |
NormalOldClass.h |
NormalOldClass2.h |
ClassTemplate1.h |
ClassTemplate2.h |
ClassTemplate3.h
Templates With Inheritance:
est1.cpp |
Test2.cpp |
Test3.cpp |
StackTemplate.h |
ClassTemplate1.h |
ClassTemplate2.h |
NonTemplateClass.h |
NonTemplateClass2.h |
Playing a .wav file from a C++ console app.
TemplateClass1.h
"This" (inside member functions, returning from functions):
[Main.cpp |
Radio.h |
Radio.cpp]
[This.cpp |
ThisExample.h]
C#
Const and Readonly in C#
Database Example
Declaring a 1D Array & (Looping with GetUpperBound and foreach)
Declaring a 2D Array & (Random Numbers)
Interface
FileIO
Process Start
Process Kill
Playing A Sound File
Property Get/Set in C#
Sending an e-mail message
Set
Inheritance:
"New" function in the derived class
"Override" function in the derived class and virtual in the base class
"Override" function in the derived class and abstract in the base class
Java
Array structure
CircleExample.java
Compiling a java file from a java program
Cursor.java
DumpClass.java
IDE with (Frames, scroll bars, buttons, text areas)
MouseExample.java
Packages
PanelExample.java
PrintExample.java
Singleton.java
SingletonTest.java
SuperHero.java (Object Serialization)
ImageWriterExample.java
Control Structures:
If |
For |
For each |
While |
Switch
Design Patterns
Class Factory
Singleton Design Pattern