CPSC 225 Intermediate Programming Spring 2005

CPSC 225 Course Information

This course continues the study of programming begun in CPSC 124. We switch to C++, a language widely used by professional programmers. C++ is similar to Java in many ways, but is a more complex language and offers many low-level features (such as direct manipulation of the computer's memory) that Java does not. C++ also removes some of the automatic checks and "safety belts" that Java provides.

The goal of this course is to build on your skills as a programmer, by reviewing and extending object-oriented programming concepts from CPSC 124 (including classes, inheritance, and polymorphism) and by adding new language features (including pointers, reference parameters, operator overloading, and templates), new algorithmic techniques (recursion), and new data structures (including linked lists, stacks, queues, trees, and the standard template library). Continued attention will also be given to "how to think like a programmer" - that is, the fundamental logical thinking and problem-solving skills which are independent of the particular language being used.

Instructor

Stina Bridgeman
bridgeman@hws.edu
Lansing 312, x3614

Office Hours

M 3-4pm, T 1-2pm, W 3-4:30pm, F 9:30-10:30am
or by appointment (schedule)

Class Hours and Meeting Place

MWF 1:55-2:50pm, Lansing 300

Course Web Page

http://math.hws.edu/~bridgeman/courses/225/s05/

You are expected to regularly consult the course web page for announcements, assignments, and most handouts.

Text

Absolute C++, 1st edition
Walter Savitch
Addison-Wesley, 2002

Additional material will be handed out or posted on the course webpage.

Prerequisites

C- in CPSC 124, or instructor permission

Rationale

Computer science revolves around programs - creating programs, analyzing programs, making programs more efficient and easier to understand, making it easier to create and maintain programs, considering what programs can and cannot do...the list goes on. The first semester of programming is intended to introduce basic programming skills - the syntax and semantics of a particular programming language, and some of the basics of program design. The second semester of programming is intended to build a more sophisticated and confident programmer, by introducing more complex language features and placing more emphasis on program design, program organization, reusable code, and other features of the object-oriented programming paradigm. Attention will also be paid to several new data structures, to augment the arrays covered in CPSC 124. Programs are all about manipulating data, and choosing an appropriate data structure for a particular application is important for the program's efficiency and simplicity.

Course Content Overview

The course material can be divided into four sections: C++ for Java programmers, pointers and linked data structures, advanced object-oriented programming, and generic programming. The objectives listed below paint - in broad strokes - what the successful student should be able to do at the end of each section.

C++ for Java programmers: The first part of the course will quickly review the basics of C++, with emphasis on those parts which are different from Java, and will introduce new topics which should be part of every programmer's toolbox. Topics include C++ program structure, expressions, conditionals, loops, subroutines, functions, reference and const parameters, default arguments, static arrays, structs, classes, inline functions, strings, I/O, file I/O, and recursion.

Objectives:

  • be able to read a C++ program and explain how the computer executes each statement
  • be able to write a C++ program given pseudocode or an English description of what the program should do
  • understand and be able to use recursion to solve problems

Pointers and Linked Data Structures: C++ takes off a number of the safety belts that Java provides when it comes to memory management. This part of the course will cover dynamic (or runtime) memory management in C++, including pointers, dynamic arrays, and classes which dynamically allocate memory. It will also introduce several new data structures including linked lists, stacks, queues, and binary trees.

Objectives:

  • understand dynamic memory management and when to use it
  • be able to read and write programs which make use of dynamic memory management
  • be able to read and write classes which make use dynamic memory management
  • know the properties of linked lists, stacks, queues, and binary trees and what applications they are suited for (including identifying which data structure, if any, is appropriate for a given application)
  • be able to implement linked lists, stacks, queues, and binary trees using linked structures and (where appropriate) arrays

Advanced Object-Oriented Programming: This part of the course will review and further explore object-oriented programming topics first introduced in Java, and will examine some additional features supported in C++. Topics include inheritance, polymorphism, virtual functions and abstract classes, operator overloading, and friends.

Objectives:

  • understand the paradigm of object-oriented programming
  • understand the importance and use of OOP features such as inheritance, polymorphism, and abstract classes
  • know the C++ syntax and semantics for inheritance, virtual functions, operating overloading, and friends, and when these things should be used

Generic Programming: The final part of the course will look at strategies for creating reusable code and for exploiting work already done, including formalizing some common patterns of code and introducing C++'s standard template library (STL). Topics include templates, generic programming, abstract data types (ADTs), and STL.

Objectives:

  • understand the idea of generic programming and why it is important
  • know the C++ syntax and semantics of templates, and when templates are appropriate
  • be able to explain what an abstract data type is
  • know the properties and typical operations of the ADTs iterator, container, list, vector, deque, stack, queue, priority queue, set, map and the specifics of the STL implementations of each
Assignments and Evaluation

Exams: There will be two midterm exams and a final exam. The midterms will be in-class, written (no programming on the computer), and closed book/notes. The final will be cumulative, but may have a somewhat greater emphasis on material covered after the second midterm (as much as it is possible to do so). The final will be entirely in the scheduled timeslot, and may contain a programming component. Details on the material covered and the exact format of each exam will be announced prior to the exam.

Quizzes: There will be frequent short (5 minute) quizzes at the start of class throughout the semester, intended to make sure that you keep up with material. They will generally be based on the current week's reading and lecture material. Quizzes are closed book and closed notes.

Homeworks: There will be weekly homework assignments, typically due at the start of class one week after they are assigned. Homeworks will generally be programming assignments, though they may also contain written assignments. You should expect to do a fair amount of programming, as doing is the best practice.

Final Project: There will be a final project, which you will have several weeks to complete. The project will give you an opportunity to work on a larger program than the others you'll create for the course, and to go through the complete process of program development from specification to design to implementation. More details will be provided later in the semester.

Lecture Attendance and Participation: You are expected to attend and participate in class. The course material is cumulative, and it is difficult to catch up if you fall behind. As a result, attendance will be taken regularly and more than three absences (for any reason) will lower your final grade. "Participation" means that you are engaged in class - you are not expected to volunteer for everything, but you should contribute to the class in a meaningful way multiple times throughout the semester.

Grades: Grades in this course will be computed as follows:

  • Homeworks: 35%
  • Final Project: 15%
  • Midterm Exams: 25% total (12.5% each)
  • Final Exam: 15%
  • Quizzes: 5%
  • Lecture Attendance and Participation: 5%

Quizzes will be graded on a three-point scale:

  • 3 points - answer is complete and correct
  • 2 points - answer is pretty good, but isn't completely correct
  • 1 point - answer is on the right track, but is very incomplete or has serious flaws
  • 0 points - quiz not handed in, or answer is completely off-track

There is much more to a good program than just having it run correctly - people have to read and work with the program at many stages in the software development process, so it is important to also create a well-organized and well-documented program. As a result, the grade for programming assignments will be based on the following criteria:

  • Functionality - does the program work correctly, and does it do what it is supposed to do? (i.e. does it meet the specifications) Note: A program which does not compile will score very poorly in this category, even if only a small error is preventing compilation. Poorly-formatted output will also reduce the score.
  • Design - reasonable choice of classes and subroutines
  • Comments/Documentation - are comments (and any other required documentation) present, appropriate, and accurate?
  • Style - includes readability (e.g. proper indentation and following standard naming conventions) and code simplicity (i.e. avoiding overly awkward constructs when a simpler solution would suffice)

Programs will be graded as follows:

  • Functionality: 60%
  • Design: 15%
  • Comments: 10%
  • Style: 15%

For the final project, the breakdown is:

  • Functionality: 60%
  • Specifications: 5%
  • Design: 15% (7.5% for the initial design, 7.5% for the final design)
  • Comments/Documentation: 10%
  • Style: 10%

Valid HTML 4.01!