|CPSC 225||Intermediate Programming||Spring 2007|
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.
M 12:30-1:30pm, W 3-4:30pm, R 10:30am-noon, F 10:30-11:30am
|Class Hours and Meeting Place||
Lecture MWF 9:05-10am, Stern Hall 204
|Course Web Page||
Absolute C++, 2nd edition
Additional material will be handed out or posted on the course webpage.
C- in CPSC 124, or instructor permission
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 five major sections: program design, data structures and abstract data types (ADTs), algorithmic techniques, testing and debugging, and C++. It is worth noting that all but the last of these sections are not specific to any one programming language - while we will study them specifically in the context of C++, the ideas and strategies can easily be applied to many other programming languages.
The objectives listed below paint - in broad strokes - what the successful student should be able to do at the end of each section. The objectives marked [C++] focus specifically on the syntax and semantics of C++. For these objectives, you should be able to correctly use the thing described (both correct syntax and knowing when it is appropriate to use it) and should understand its meaning and how it is executed by the computer (the semantics).
Program Design: The single most crucial component of this course is gaining skill and confidence with program design. "Program design" refers to the process of going from an idea of what you want the program to do to a detailed enough description that the actual coding of the program is relatively straightforward. We'll study a "design recipe" (based on the design recipes of Felleisen, Proulx, Cartwright, and others) for approaching the design process, and study how to tackle the process of developing an algorithm to solve a problem.
Data Structures and Abstract Data Types (ADTs): Programs are, ultimately, all about manipulating data. How that data is stored and accessed can have a significant effect on how quickly a program runs, and how easy it is to write and understand a program. Topics include low-level data structures (arrays and linked lists), high-level abstract data types (vectors, lists, stacks, queues, and binary trees), and, time permitting, the C++ Standard Template Library (STL).
Algorithmic Techniques: One of the most useful realizations in programming is that the same kinds of problems arise over and over. Solving new problems becomes easier as you build up a toolbox of solution "patterns" - if you can match characteristics of your current problem to one that you already know how to solve, you may be able to use the known solution as a starting point for the current problem. A thorough study of algorithmic patterns is beyond the scope of this course (take CPSC 327!), but we'll be alert to solution patterns as we come across them and will study recursive search and backtracking - a very powerful technique applicable to a surprisingly large collection of interesting problems.
Testing, Debugging, and Robustness: Writing a program is only half the job - a program must also be thoroughly tested in order to verify that it works correctly. If a test fails, then the error must be located and corrected. Topics include designing robust programs (i.e. error-checking), error-prevention (or at least early detection) strategies, designing comprehensive tests, and debugging strategies.
C++: Along the way, we'll also study the syntax and semantics of C++. Many of the basic programming structures will be the same as Java; we'll focus on those aspects which are different or which Java does not provide. A major topic will be memory management - Java handles all of the memory allocation and deallocation automatically, while C++ gives the programmer more control. Many of the topics to be addressed are included in the objectives above; only ones not already listed are given below.
|Assignments and Evaluation||
Labs: Many lab meetings will have a lab exercise. These exercises will reinforce specific concepts from class, and will generally be completed in pairs. It is intended that most lab exercises will be completed and handed in during the lab period, but solutions may be handed in any time up until the start of the following week's lab without penalty. Only one handin per pair is required.
Programming Assignments: The main focus of the course will be a series of programming assignments in which both design and implementation will be emphasized. In these, you'll go all the way from specifications to an implemented - and debugged - program. These assignments will be of different sizes, from smaller one-week programs to larger three- or four-week projects.
Journal: A regular journal is required. Becoming a good programmer is about more than just achieving the goal of a working program; you will gain more if you also reflect on the process of how you created that program. The purpose of the journal is to encourage that reflection. See the course wiki for more information and to post your journal entries.
Exams: There will be two midterm exams and a final exam. The midterm exams will each have two components - the closed-book in-class part will focus on C++ syntax and basic concepts, while the open-book take-home part will emphasize design and deeper concepts. The take-home parts may involve programming on the computer. The final exam will be closed book and will take place in the scheduled final exam timeslot. More details about each exam will be announced prior to the exam.
Final Grades: Final grades in this course will be computed as follows:
Course Wiki: In addition to being where you'll post your journal entries, the course wiki is a place for comments and discussion - post questions or thoughts about the reading or lectures. Participating in the wiki is part of participating in the course; you should aim to make at least one substantive comment per week.
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
Late Policy and Collaboration: See the course policies for the late policy and collaboration policy.