University of LaVerne-Athens Campus

Department of Science, Computer Science and Mathematics

Winter 2004


Object Oriented Programming Using C++ 



Semester Hours:      4

Pre-requisites:          CMPS 301 – Programming Concepts

Requirement:           Computer Science and Computer Engineering, B.S.

Instructor:                 Nicholas Harkiolakis, Ph.D.

Associate Professor,

Chair, Dept. of Science, Computer Science and Mathematics

Class Sessions:         Monday – Wednesday 11:30 – 14:00

Location:                   Main Computer Lab

Course Site:              Course Home Page

Office Hours:            Monday – Wednesday 9:00 – 11:00 and 14:00 – 15:00


Message phone:       210-6898850



Course Description

Object - oriented programming. Basic concepts, operators, functions, development of inheritance. Polymorphisms and their implementation via virtual functions, abstract base classes, and pure virtual functions.


Teaching Goals

·      To introduce and familiarize the students with object technology.

·      To achieve the mind frame change from procedural programming to object-oriented programming.

·      To present the advantages to software engineering from the use of object technology.


Learning Objectives

The students will be able to:

·      To understand a typical C++ program development environment and be able to write computer programs in C++.

·      To understand the software engineering concepts of encapsulation and data hiding.

·      To understand how to create, use, and destroy class objects.

·      To be able to create and destroy objects dynamically.

·      To understand operator overloading and inheritance.


Course Requirements

·        Class attendance and participation

·        Weekly homework assignments and tests

·        In class assignments

·        Course projects

Default Assumptions

1.      Unfinished lab activities will always be added to homework

2.      All homework and projects are due on the next scheduled Monday session




Visual C++ .NET How to Program

Deitel, Prentice Hall, 2003



Weekly Schedule

Week I                                                                                   January 7, 2004

Introduction to .NET, Visual Studio .NET and Visual C++.NET Programming

To understand the Microsoft .NET initiative

To introduce Managed Extensions for C++

To become familiar with the Visual Studio .NET IDE

To write simple Visual C++ .NET programs

To use input and output statements

To become familiar with primitive data types

To understand basic memory concepts

To use arithmetic operators

To understand the precedence of arithmetic operators

To write decision-making statements

To use relational and equality operators



Simple Program structure

Memory concepts



Lab Activities:

      Familiarization with Visual Studio .NET environment

      Simple GUI development


Exercises 3.3 to 3.16                                     due on January 12, 2004



Week II                                                                                  January 12, 2004

Control Statements: Part 1

To use the if and if…else selection statements to choose among alternative actions

To use the while repetition statement to execute statements in a program repeatedly

To understand counter-controlled repetition and sentinel-controlled repetition

To use the increment, decrement and assignment operators




if selection statement

if…else selection statement

While repetition statement

Assignment operators

Increment and decrement operators

Lab Activities:

      Simple calculator simulator: Basic operations


Exercises 4.1 to 4.16                                     due on January 19, 2004     


Textbook Chapter 3                         11:30-12:00 on January 14, 2004



Week III                                                                                January 19, 2004

Control Statements: Part 2

To use the for and do…while repetition statements to execute statements in a program repeatedly

To understand multiple selection with switch selection statement

To use break and continue program-control statements


Essentials of counter-controlled repetition

Using the for statement

switch multiple selection statement

do…while repetition statement

break and continue statements

Logical operators

Lab Activities:

      Number display

      Simple calculator simulator: Error control


Exercises 5.4 to 5.10                                     due on January 26, 2004


Textbook Chapter 4                         11:30-12:00 on January 21, 2004



Week IV                                                                                January 26, 2004


To construct programs modularly from small pieces called functions

To become familiar with the common math methods available in the Framework Class Library

To create functions

To understand the mechanisms for passing data between functions

To introduce simulation techniques that use random number generation

To understand how the visibility of identifiers is limited to specific regions of programs

To understand how to write and use functions that call themselves


Functions and methods in Managed Extensions for C++

Math class methods


Argument promotion

Namespaces in managed Extensions for C++

Value types and reference types

Pointers and references

Passing arguments

Random-number generation

Scope rules


Recursion vs. Iteration

Function overloading

Lab Activities:

      Clock display simulator

      Simple calculator simulator: Statistics module


Exercises 6.6 to 6.15                                     due on February 2, 2004


Textbook Chapter 5                         11:30-12:00 on January 28, 2004



Week V                                                                                  February 2, 2004


To become familiar with the array data structures

To understand how managed arrays store, sort and search lists and tables of values

To understand how to declare and initialize a managed array

To be able to refer to individual elements of a managed array

To understand basic sorting techniques

To be able to declare and manipulate multidimensional managed arrays



Declaring and allocating arrays

Passing arrays to functions

Sorting arrays

Searching arrays

Multidimensional arrays

Lab Activities:

      8 Queens puzzle

      Simple calculator simulator: Statistics module continued


Exercises 7.3 to 7.11                                     due on February 9, 2004


Textbook Chapter 6                         11:30-12:00 on February 4, 2004



Week VI                                                                                February 9, 2004
Object-based programming

To understand encapsulation and data hiding

To understand the concepts of data abstraction and abstract data types

To create, use and destroy objects

To control access to data members and methods

To understand the use of the this pointer

To understand namespaces and assemblies


Class scope

Controlling access to members


Using overloaded construction


Using the this pointer

Garbage collection

static class members

const keyword

Data abstraction and information hiding

Software reusability

Namespaces and assemblies

Lab Activities:

      e-mail client-server simulation

      Simple calculator simulator: Geometry module


Exercises 8.3 to 8.8                                       due on February 16, 2004


Textbook Chapter 7                         11:30-12:00 on February 11, 2004



Week VII                                                                               February 16, 2004
Object Oriented Programming: Inheritance

To understand inheritance and software reusability

To understand the concepts of base classes and derived classes

To understand member access specifier protected

To understand the use of constructors and destructors in base and derived classes

To present a case study that demonstrates the mechanics of inheritance


Base classes, derived classes and protected members

Relationship between base classes and derived classes

Constructors and destructors in derived classes

Software engineering with inheritance

Lab Activities:

      Simple calculator simulator: Geometry module continued


Exercises 9.3 to 9.8                                       due on February 25, 2004


Textbook Chapter 8                         11:30-12:00 on February 18, 2004



Week VIII                                                                             February 25, 2004
Object-Oriented Programming: Polymorphism

To understand the concept of polymorphism

To understand how polymorphism makes systems extensible and maintainability

To understand the distinction between abstract classes and concrete classes

To learn how to create __sealed classes, interfaces and delegates


Derived-class-object to base-class-object conversion

Abstract classes


Operator overloading

Lab Activities:

2D game development with real time graphics and sound


Exercises 10.3 to 10.8                                   due on March 1, 2004

Optional challenge project: Souvlaki Taverna Simulation

Students who complete the project will receive an additional 10% towards their final grade. The deadline for this project is  13:00am on March 24, 2004


Textbook Chapter 9                         11:30-12:00 on February 25, 2004



Week IX                                                                                March 1, 2004
Exception Handling

To understand exceptions and error handling

To use try blocks to delemit code in which exceptions may occur

To throw exceptions

To use catch blocks to specify exception handlers

To use the __finally block to release resources

To create programmer-defined exceptions


Exception handling overview, .NET exception hierarchy

__finally block

Exception properties

Programmer-defined exception classes

Lab Activities:

      Database simulation

      2D Game development continued


Exercises 11.3 to 11.8                                   due on March 8, 2004


Textbook Chapter 10                       11:30-12:00 on March 3, 2004



Week X                                                                                  March 8, 2004
Graphical User Interfaces Concepts

To understand the design principles of graphical user interfaces

To create graphical user interfaces

To create and manipulate buttons, labels, lists, text boxes and panels

To be able to use mouse and keyboard events

To be able to display list boxes and combo boxes

To be able to create menus, window tabs, and multiple-document-interface (MDI) programs

To create custom controls


Windows forms

Event-handling model

Control properties and layout

Mouse and keyboard event handling



Lab Activities:

      Hangman game: GUI design


Exercises 12.3 to 12.7                                   due on March 15, 2004


Textbook Chapter 11                       11:30-12:00 on March 10, 2004



Week XI                                                                                March 15, 2004
Graphics and Multimedia

To understand graphics contexts and graphics objects

To manipulate colors and fonts

To use class Image to manipulate and display images

To use Windows Media Player and Microsoft Agent


Graphics contexts and graphics objects

Color control

Font control

Drawing lines, rectangles and ovals

Drawing polygons and polylines

Introduction to multimedia

Loading, displaying and scaling images

Windows Media Player

Microsoft Agent

Lab Activities:

      Hangman game: Microsoft Agent enhancement


Hangman game                                            due on March 24, 2004



Week XII                                                                               March 22, 2004
Files and Streams

To create, read, write and update files

To use classes File and Directory

To use the FileStream and BinaryFormatter classes to read objects from, and write objects to, files

To become familiar with sequential-access and random-access file processing


Data hierarchy

Files and streams

Classes File and Directory

Creating a sequential-access file

Reading data from a sequential-access file

Random-access files

Lab Activities:

      Practice simple IO operations for sequential and random access files




Method of Evaluation

·      Class Attendance and Participation:                                                    10%

·      Weekly Tests:                                                                                          45%

·      Weekly Homework Exercises:                                                              30%

·      Projects                                                                                                     15%

·      Optional Challenge Project (for additional credits)                          10%



Plagiarism Policy

Students are responsible for performing academic tasks in such a way that honesty in not in question.  Please refer to the Academic Honesty Policy in the University Catalog for the full detailed policy on this matter.



Attendance Policy

Attendance is Compulsory.  Contact instructor for any absence.  Final student grade will be reduced by 10% for every absence made above three. Course must be dropped if missing more than five class sessions



Class Participation

Students are expected to follow the professor’s guidelines for working classroom assignments.



Make-up and late assignments

Students are expected to manage their time appropriately so as to submit their assignments on time. Late assignments will receive no credit. Exceptions to this rule will be considered on an individual basis.



This course may be modified, verbally or in writing, at any time during the term at the discretion of the instructor or department


Welcome to C++