This page documents what we do in class. It contains C++ programs (and occasional C or Java programs) that we will discuss in class, reading assignments from our textbook, simple homework exercises that you can work on for practice and exam preparation (not for credit), links to other sources of information, etc.
The reading assignments and practice problems are listed by the date on which they were assigned. The sample program files are listed by the date on which they were used. You can click on any .cpp , .h , .c , or .java link and see the source code. When you are viewing source code, you can use your browser's "File -> Save As..." menu item to save a copy of the file on your computer. It is a good idea for you to "play" with these example programs; compile them, run them, make simple changes to them and compile and run them again.
- Wednesday, April 30.
- The final exam is Monday, May 5, from 1:00-3:00pm.
- The final exam will cover Chapters 1-8, Chapter 10, Sections 11.1 and 11.2, Sections 12.1 and 12.2, and Chapter 17.
- Monday, April 28.
- Read Section 17.2, pages 843-847.
- Here is a zip file containing example programs for Chapter 17 of the textbook along with several examples of exceptions in Java.
- Wednesday, April 23.
- Your tenth homework assignment is available from the homework page
- Read Section 17.1, pages 822-843.
- Monday, April 21.
- Read Sections 12.1-12.2, pages 617-637.
- Here is a zip file containing example programs for Chapter 12 of the textbook.
- Here is a link to a brief movie, made at Stanford University, about pointers.
- And here is a link to some more information, from Stanford University, about pointers.
- Wednesday, April 16.
- Your ninth homework assignment is available from the homework page
- Read Sections 11.1-11.2, pages 569-603.
- Here is a zip file containing example programs for Chapter 11 of the textbook.
- Monday, April 7.
- NOTE: The second midterm exam is next Monday, April 14.
The exam will cover Chapters 6, 7, 8 and 10.
- Here is a zip file containing example programs for Chapter 10 of the textbook.
- Wednesday, April 2.
- Your eighth homework assignment is available from the homework page
- NOTE: We shall postpone the second midterm exam by one week to Monday, April 14. This will give us time to finish Chapter 10 before the exam.
- For Monday, read Sections 10.4-10.5, pages 536-553.
- Wednesday, March 26.
- Your seventh homework assignment is available from the homework page
- Monday, March 24.
- Read Sections 10.1-10.3, pages 493-535.
- Here is a zip file containing the example programs from Chapter 9 of the textbook.
- Wednesday, March 19.
- Read Section 9.2, pages 471-486.
- Monday, March 17.
- Read Section 9.1, pages 457-471.
- Wednesday, March 5.
- Here is a zip file containing the example programs from Chapter 8 of the textbook.
- Monday, March 3.
- Your sixth homework assignment is available from the homework page
- For Wednesday, read Section 8.2, pages 428-445.
- Here is a short program that demonstrate a subtle aspect of defining friend functions. Taken from an article in "C/C++ Users Journal".
- Wednesday, February 27.
- Read Chapter 7, but we will not go over much of it in class since most of what is in this chapter is the same as for Java. The main difference is that C++ evaluates boolean expression a bit differently (see in particular pages 339-340). Be sure to read the page about "enumeration types", page 342, and also the pages about blocks and scope, pages 357-363.
- Read Section 8.1, pages 405-427.
- A simple example using the
bool data type.
- A simple example of an
enum data type.
- An example, translated into three different languages, that shows how each language handles the concept of block scope in a different way.
- Wednesday, February 20.
- Remember that the first midterm exam is on Monday. It will cover the first 6 chapters of the book, up to Section 6.2.
- Here is another example of using "information hiding".
- Here is the same example of "information hiding" written in Java. This Java version is a bit cleaner than the C++ version.
- Monday, February 18.
- Your fifth homework assignment is available from the homework page
- Read Section 6.3, pages 315-323.
- Here is a simple example of using "information hiding" in a class, that is, separating the public interface of the class from its private implementation.
- Wednesday, February 13.
- Read Section 6.2, pages 282-314.
- Some examples of defining a class and using objects from the class.
- Monday, February 11.
- NOTE: We shall postpone the first midterm exam by one week to Monday, February 25. This will give us time to finish Chapter 6 before the exam.
- Your fourth homework assignment is available from the homework page
- Here is a program that demonstrates ideas from Section 5.4 of the textbook.
- Some examples demonstrating ideas from Section 6.1.
- Wednesday, February 6.
- Read Sections 5.3 and 5.4, pages 262-289.
- Read Section 6.1, pages 308-321.
- These files demonstrate some more I/O ideas.
- When working with character I/O, as some of these example programs do, it is sometimes useful to look up characters in an ASCII table. There is an ASCII table on page 904 of our textbook, but it is not complete. Here is a link to an online ASCII table that has all 256 of the (extended) ASCII character codes, including the non-printable "control codes" (i.e., the codes below 32).
- Here are two little programs that print out all of the ASCII characters. Compare the output with the above ASCII chart. The second version is a small puzzle to think about.
- Monday, February 4.
- Your third homework assignment is available from the homework page
- Read Section 5.2, pages 216-231.
- Here are three files that demonstrate some I/O ideas that are not in the textbook.
- Wednesday, January 30.
- Read Chapter 4, Section 4.4, pages 186-191.
- Read Chapter 5, Section 5.1, pages 201-216.
- Here are a few more examples of using (or misusing) call-by-reference.
- Monday, January 28.
- Here is an example of a function that uses call-by-reference. Compare it with the call-by-value version given last week.
- Wednesday, January 23.
- Your second homework assignment is available from the homework page.
- Read Chapter 4, Sections 4.1 and 4.2, pages 157-176.
- Here is a simple program that demonstrates call-by-value parameter passing and another program that demonstrates the idea of procedure abstraction.
- In Chapter 3, notice pages 104-106 about casting. The notation for casting in C++ is different from the notation used in Java.
- Wednesday, January 16.
- Read Chapter 3, pages 99-147.
- Here is a sequence of programs that show how simple C++ programs compare with Java programs. The idea of these examples is to understand how each program is structured in the computer's memory when the program executes.
- Monday, January 14.
- Your first homework assignment is available from the homework page. Be sure to also read the homework grading criteria and the instructions for turning in your assignment when it is done.
- For the first week, read Chapters 1 (pages 3-29) and 2 (pages 37-87) from the course textbook. Be sure to pay attention to the "Self-Test Exercises" that are scattered throughout the chapters (the answers to these problems are at the end of each chapter).
- Here is a template for writing simple C++ programs.
- An example program using some basic C++ data types.
- Here are three versions of a simple C++ program that uses a user defined function.
- You can use the following link to download a zip file of the source code examples from our textbook.
|
|