Object-Oriented Programming Dr. Napoleon H. Reyes, Ph.D. Computer Science Institute of Information...

19
Object-Oriented Object-Oriented Programming Programming Dr. Napoleon H. Reyes, Ph.D. Dr. Napoleon H. Reyes, Ph.D. Computer Science Institute of Information and Mathematical Sciences Rm. 2.56 QA, IIMS, Albany Campus Email: [email protected] Tel. No.: 64 9 4140800 x 9512 Fax No.: 64 9 441 8181 Consultation Hours: After every lecture for 1 hr Tutorials: Fridays, 9am at (Computer Lab Computer Lab QB4) Lectures: Mon, 2pm (AT3); Tue, 2pm at (AT5); Wed., 9am (AT3) 159.234

Transcript of Object-Oriented Programming Dr. Napoleon H. Reyes, Ph.D. Computer Science Institute of Information...

Page 1: Object-Oriented Programming Dr. Napoleon H. Reyes, Ph.D. Computer Science Institute of Information and Mathematical Sciences Rm. 2.56 QA, IIMS, Albany.

Object-Oriented ProgrammingObject-Oriented Programming

Dr. Napoleon H. Reyes, Ph.D.Dr. Napoleon H. Reyes, Ph.D.Computer Science

Institute of Information and Mathematical Sciences

Rm. 2.56 QA, IIMS, Albany Campus

Email: [email protected]

Tel. No.: 64 9 4140800 x 9512

Fax No.: 64 9 441 8181

Consultation Hours: After every lecture for 1 hr

Tutorials: Fridays, 9am at (Computer Lab Computer Lab QB4)

Lectures: Mon, 2pm (AT3); Tue, 2pm at (AT5); Wed., 9am (AT3)

159.234

Page 2: Object-Oriented Programming Dr. Napoleon H. Reyes, Ph.D. Computer Science Institute of Information and Mathematical Sciences Rm. 2.56 QA, IIMS, Albany.

Schedule

For the first week:

Monday, Wednesday, Friday – all lectures, no tutorial tomorrow!

Computer Lab tutorial starts next week – It will be every Friday

Tutor: Alwyn Husselmann

159.234

Page 3: Object-Oriented Programming Dr. Napoleon H. Reyes, Ph.D. Computer Science Institute of Information and Mathematical Sciences Rm. 2.56 QA, IIMS, Albany.

Topics for Discussion

Pre-requisites

Course Overview

Learning Outcomes

Texts and Course Material

Assessment

Course Schedule

159.234

Demo

Page 4: Object-Oriented Programming Dr. Napoleon H. Reyes, Ph.D. Computer Science Institute of Information and Mathematical Sciences Rm. 2.56 QA, IIMS, Albany.

Pre-requisites

Have taken up Programming Fundamentals (159.101 )

159.234

Students are expected to:

Page 5: Object-Oriented Programming Dr. Napoleon H. Reyes, Ph.D. Computer Science Institute of Information and Mathematical Sciences Rm. 2.56 QA, IIMS, Albany.

Classes, Objects, Templates, Inheritance, Polymorphism

Course Overview

Introduction to OOP

Object Libraries

159.234

Calendar Prescription

Problem-based learning

A Graphics Engine will be provided to make learning OOP more fun

Page 6: Object-Oriented Programming Dr. Napoleon H. Reyes, Ph.D. Computer Science Institute of Information and Mathematical Sciences Rm. 2.56 QA, IIMS, Albany.

Understand contents of and be able to use features of the STL (Standard Template Library)Learning Outcomes

Understand concepts of objects, inheritance & polymorphism

Be able to write programs in the C++ Programming Language

159.234

On successful completion of the course, the students should be able to:

Have some familiarity with JAVA

Accomplishing the assignments covers all these objectives!Accomplishing the assignments covers all these objectives!

Page 7: Object-Oriented Programming Dr. Napoleon H. Reyes, Ph.D. Computer Science Institute of Information and Mathematical Sciences Rm. 2.56 QA, IIMS, Albany.

Student Responsibility

Note:

159.234

If a student cannot attend lectures/tutorials it is the student’s responsibility to find out what was discussed in lectures / tutorials (possible changes to assignments, questions & answers).

Page 8: Object-Oriented Programming Dr. Napoleon H. Reyes, Ph.D. Computer Science Institute of Information and Mathematical Sciences Rm. 2.56 QA, IIMS, Albany.

Creating Turbo C++ Games by Clayton Walnum

Texts and Course MaterialTexts and Course Material

C++ for C Programmers by Ira Pohl

http://www.cs.colorado.edu/~main/bgi/doc/index.htmlhttp://www.cs.colorado.edu/~main/bgi/doc/index.html

159.234

http://csci.biola.edu/csci105/using_winbgi.htmlhttp://csci.biola.edu/csci105/using_winbgi.html

References (optional, for further information)

Deitel & Deitel, C++ How to program, 3rd Ed.,

Prentice Hall, 2000

Bruce Eckel, Thinking in C++, 2nd Ed.

http://www.mindview.net/Books/DownloadSites

Chapter 6 from Physics for Game Developers Book: Chapter 6 from Physics for Game Developers Book: ProjectileProjectile

http://www.massey.ac.nz/~nhreyes/Massey/159234.html

Page 9: Object-Oriented Programming Dr. Napoleon H. Reyes, Ph.D. Computer Science Institute of Information and Mathematical Sciences Rm. 2.56 QA, IIMS, Albany.

Texts and Course MaterialTexts and Course Material

159.234

Other References (optional, for further information)

Bruce Eckel, Thinking in JAVA, 3rd Ed.

http://www.mindview.net/Books/DownloadSites

Page 10: Object-Oriented Programming Dr. Napoleon H. Reyes, Ph.D. Computer Science Institute of Information and Mathematical Sciences Rm. 2.56 QA, IIMS, Albany.

AssessmentAssessment

159.234

33 assignments: 30%30%

Final Exam (3 hours): 70%70%

In order to pass the course you must have (both of them).

• The exam mark at least 45% from max.• The final mark greater than or equal to 50%.

All assignments will be submitted electronically.

Page 11: Object-Oriented Programming Dr. Napoleon H. Reyes, Ph.D. Computer Science Institute of Information and Mathematical Sciences Rm. 2.56 QA, IIMS, Albany.

Assessment

159.234

Program solutions that do not compile or do not run in our laboratories get 0 marks.

Late assignments will be penalized

Assignments may be completed in groups

all members of the group should be named in the source file of each assignment they contributed.

Assessment Approximate Due Date / Deadline

Assignment #1 – a simple object-oriented game will be developed that will require a good understanding of objects, inheritance and polymorphism; lectures, tutorials and code snippets will be provided to help the students develop the game

Mar. 30, 2009

Assignment #2 – requires re-architecturing of assignment #1 to incorporate STLs, allowing for more sophisticated functionalities of objects: Tank with bullets and bomb, etc.

April 27, 2009

Assignment #3 – Jumping Tank, flying ledgesMay 25, 2009

Page 12: Object-Oriented Programming Dr. Napoleon H. Reyes, Ph.D. Computer Science Institute of Information and Mathematical Sciences Rm. 2.56 QA, IIMS, Albany.

Assessment

159.234

Each group member will receive the same grade.

Students in a team have the authority (in consultation with the lecturer) to "expel" any member that does not meet obligations .

The collaboration is limited only to members within each group.

It is a student responsibility to check their assignment marks and notify in writing any errors they might find no later than 10 days after the day the marks were made available.

Page 13: Object-Oriented Programming Dr. Napoleon H. Reyes, Ph.D. Computer Science Institute of Information and Mathematical Sciences Rm. 2.56 QA, IIMS, Albany.

Course Schedule

1.1. Introduction Introduction

2.2. Intro to C++ Intro to C++

159.234

Review of C, Memory Allocation

I/O, new types

Page 14: Object-Oriented Programming Dr. Napoleon H. Reyes, Ph.D. Computer Science Institute of Information and Mathematical Sciences Rm. 2.56 QA, IIMS, Albany.

4. 4. NamespaceNamespaceScoping rules

Course Schedule

3.3. Functions Functions

159.234

Overloading, Reference parameters

5.5. Classes ClassesObjects, Scope, Member functions

Page 15: Object-Oriented Programming Dr. Napoleon H. Reyes, Ph.D. Computer Science Institute of Information and Mathematical Sciences Rm. 2.56 QA, IIMS, Albany.

Course Schedule

6.6. Constructors, Initialiser Lists,Destructors Constructors, Initialiser Lists,Destructors

7.7. Friends, Operator Overloading Friends, Operator Overloading

159.234

8. 8. Templates, ExceptionsTemplates, Exceptions

9.9. Inheritance, I/O, Constructs Inheritance, I/O, Constructs

10. 10. STLSTL

Page 16: Object-Oriented Programming Dr. Napoleon H. Reyes, Ph.D. Computer Science Institute of Information and Mathematical Sciences Rm. 2.56 QA, IIMS, Albany.

Course Schedule 159.234

11.11. JAVA Introduction JAVA Introduction

12.12. JAVA compared to C++ JAVA compared to C++

Review of the Course

13.13. Study break/Final Examination Study break/Final Examination

Page 17: Object-Oriented Programming Dr. Napoleon H. Reyes, Ph.D. Computer Science Institute of Information and Mathematical Sciences Rm. 2.56 QA, IIMS, Albany.

Course Schedule

• Send your email address to [email protected] to receive announcements, tips, etc. during the duration of the semester

• Download gcc

• Check out OOP lecture notes at www.massey.ac.nz/~nhreyes

• Download JAVA (e.g. NetBeans 6.1, http://www.netbeans.org/downloads/)

• Try to get hold of some of the references for the paper

159.734

TasksTasks

Page 18: Object-Oriented Programming Dr. Napoleon H. Reyes, Ph.D. Computer Science Institute of Information and Mathematical Sciences Rm. 2.56 QA, IIMS, Albany.

Demo 159.234

C++ Tank Game

JAVA Tank

Robot Navigation (AI)

Shooting & Tank with AI

3-D Tank with AI

- Physics, Fuzzy Logic, Zoom / UnZoom

- Fuzzy Logic + A* algorithm

- Fuzzy Logic for target pursuit & obstacle avoidance, auto speed control

- Integration of Physics formulas, transformation equations for device independence & graphics; implemented in an object-oriented fashion

- Graphics in JAVA implementing the tank class

Page 19: Object-Oriented Programming Dr. Napoleon H. Reyes, Ph.D. Computer Science Institute of Information and Mathematical Sciences Rm. 2.56 QA, IIMS, Albany.

END