CSc 11: Introduction to Computing
Assignment #5 (Chapters 7 and 8)

Write answers to the following exercises, found in the textbook: 7.2, 7.9(a,b,c,f, g), 7.22(a,b,d), 8.3, 8.4, 8.5, 8.14, 8.38.
The multimedia for chapter 7 (Loops) invites you to look at several programs and write a few. Hand in your implementation of negcubes.cc and loopbugs.cc (debugged).
Design and implement programs that solve the problems posed in exercises in the textbook: 2.86, 2.87 (using Knobby's World while loops), 7.28 and 7.43.

Extra credit: exercises 7.29, 7.62.

Due: Thursday, 10/26, anytime before midnight.

Hand in: When you're ready to submit your assignment, combine the answers to all the exercises (including source code for the programming exercises. Then, using a web browser, go to The Student Drop Box for Introduction to Computing. (It's under Student Tools.) Click on the Browse button, then find your files in their folder (if you put it on a floppy disk, it's in A:). When you've selected your file, you should see a directory path to this file next to the Browse button. If it looks right to you, click on the Send File to Instructor button. Then you should see this file listed under Current Files in your DropBox. The Teaching Assistant, Jeffrey Eynon, will get this file and grade it

Hints:
For exercise 7.9, the ASCII value for '3' is not given explicitly in Figure 3.16; it's one greater than the ASCII code for '2'. Also, remember, in C++ the truth values or zero (for false) and any non-zero value (for true).

For 7.22, show the values produced by these boolean expressions. Boolean expressions do not need to have comparisons. Pages 186-187 in the book shows how any expression that produces either 0 or non-zero can serve as a boolean expression in C++. Exercise 7.22 is focusing on boolean (logical) operators.

The programs shown in the book, are available on the CD-ROM (assuming the CD-ROM) is drive D:, in D:\gcc\lookout\ch7) as well as the LAN (Y:\lib\gcc\lookout\ch7). The name of the programs appear in comments in the first line of each program in the book.

For 7.62, take a look at filetest.cc.

Prof. Blank