CPSC 225 Intermediate Programming Fall 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, time permitting, 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 2:30-3:45pm, T 3:30-5pm, R 10:15-11:30am, F 1:30-2:30pm
or by appointment (schedule)


Class Hours and Meeting Place

Lecture MWF 10:10-11:05am, Lansing 300
Lab R 8:45-10:10am, Gulick 208


Course Web Page

http://math.hws.edu/~bridgeman/courses/225/f05/
You are expected to regularly consult the course web page for announcements, assignments, and most handouts.


Text

Absolute C++, 2nd edition
Walter Savitch
Addison-Wesley, 2006

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. We will jump between topics in each section, using the central theme of organizing data in a program as motivation and application for the topics studied. 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 several new topics which should be part of every programmer's toolbox. Additional C++ language features will be introduced throughout the course. 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 major section 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, time permitting, 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 Sequence, SortedSequence, Stack, Queue, BinaryTree, and Map (others may be added as time permits)
  • (time permitting) 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 first midterm will be in class, written (no programming on the computer), and closed book/notes. The second midterm will be a take-home exam, open book/notes, and may involve some programming on the computer. 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.

Homework: Homework will be assigned most weeks and is typically due at the start of class one week after it is assigned. Homeworks will generally be programming assignments, though they may also contain written problems. You should expect to do a fair amount of programming, as doing is the best practice. See the course policies for the late policy and the collaboration policy for homework.

Labs: New this semester, there will be weekly lab meetings. There will not be separate lab assignments; rather, the lab period is an opportunity to work on the homework assignments. Your time in lab will be most effective if you spend some time thinking about the assignment before lab, so that you can use the lab to get questions answered. To help you with this, homeworks will generally be assigned the day before lab (and will often be posted even earlier).

Final Project: There will be a final project, which will cover much of the second half of the semester. 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. See the course policies for the late policy and the collaboration policy for the final project.

Attendance and Participation: You are expected to attend and participate in class and lab. The course material is cumulative and many topics will be covered, making it difficult to catch up if you fall behind. Missing class - for any reason - often results in lower grades because important material was missed. Similarly, not participating in class even if you are physically present may mean that you aren't actively following the material and thus may be missing more sophisticated or subtle points.
Attendance will be taken regularly and more than three absences (for any reason, in class or lab) will lower your final grade by 0.5% per additional absence, up to half a letter grade. No distinction is made between excused and unexcused absences when computing the final grade; however, the number of unexcused absences is considered when deciding whether or not to round up a final grade which is just below a grade-level cutoff. See the course policies for the definition of unexcused and excused absences.

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

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

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 and reasonable organization of code within 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)

The approximate weights for programs will be as follows:

  • Functionality: 60-70%
  • Design: 5-15% (depends on how much design is required beyond the assignment specification)
  • 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%

There are no officially scheduled extra credit assignments - do your best on each regular assignment as it comes along, rather than blowing something off with the idea of making up for it later with extra credit. That being said, there may be opportunities for extra credit on some assignments. Extra credit problems, if present, are likely to be longer, harder, more sophisticated, and/or trickier than the regular problems. You should view extra credit as a bonus for going deeper into the material rather than as a safety net.


Valid HTML 4.01!