CSCI 2610/2611
Spring 2003

Last modified 5/5/03

Announcements

The final exam will be at 11:00 on Tuesday, May 6.


Syllabus

This is a computer programming course using C++. See the syllabus for details.


Lab and help hours

Lab assistants are available during certain hours for assistance. See the following pages.


Assignments

  1. programming assignment 1
  2. programming assignment 2
  3. programming assignment 3
  4. programming assignment 4
  5. programming assignment 5
  6. programming assignment 6
  7. programming assignment 7
  8. programming assignment 8
  9. programming assignment 9
  10. programming assignment 10


Self-test exercises

You should make a habit of working most of the self-test exercises in the book, and checking your answer against the answer in the book. That will help you remember the material. Additional exercises will be posted here.

  1. Practice questions for test 1
  2. Solutions to practice questions for test 1
  3. Practice questions for test 2
  4. Solutions to the practice questions for test 2


Additional documents


Sample C++ programs

The following are sample C++ programs with some commentary.


Lecture summaries

  1. [1/7/03] We went over the syllabus and then began reviewing the basics of C++. We looked at elementary types, variables, assignment statements and expressions. This material is in chapter 2 of the text, and you should read that chapter.

  2. [1/9/03] We continued to look at C++, including comparison and boolean operators, if-statements and while-statements. We did an example of a loop.

  3. [1/14/03] We discussed how to design loops, using as examples a loop to compute powers and a loop to compute the sum of the first n numbers. Two design strategies are the dynamic strategy, based on thinking about what actions you want to repeat, and the static design strategy, based on thinking about relationships between variables that are always true. We did a complete main program that reads two integers x and n and prints x to the n-th power.

  4. [1/16/03] We covered more material on designing loops, looking at the static and dynamic strategies more. Then we began to look at functions.

  5. [1/21/03] Today was treated like a Monday. No class.

  6. [1/23/03] Snow day. Classes canceled due to bad weather.

  7. [1/28/03] We continued to look at functions. We discussed function contracts, and how the function definition is related to its contract.

  8. [1/30/03] We looked at recursion, and how to use recursion as a replacement for a loop.

  9. [2/4/03] We continued to look at how to design functions. We looked at call-by-reference vs. call-by-value.

  10. [2/6/03] We began to look at objects by looking at the objects cin and cout. We saw how to build similar objects that are tied to other files.

  11. [2/11/03] We went over the Towers of Hanoi puzzle, and how to solve it. This week's exercise involves this puzzle. Then we looked more at objects and how to use objects in C++.

  12. [2/13/03] We looked at structures and classes. A structure is similar to a class, but it only contains public variables. A class can also contain private variables, public methods and private methods. We build a small class with some variables, methods and a construtor.

    Most students will have a great deal of difficulty understanding this material. The goal here is to expose you to it for the first time. You will not be expected to gain a solid grasp of designing classes, or of object-oriented programming.

  13. [2/18/03] No class.

  14. [2/20/03] Exam 1.

  15. [2/25/03] We went over exam 1.

  16. [2/27/03] We began to look at arrays.

  17. [3/3/02-3/7/03] Spring break

  18. [3/9/03] We reviewed arrays, then looked at null-terminated strings and computation on null-terminated strings.