Homework 3 UCR CS10: Introduction to Computer Science Spring Quarter 2004, Lecturer: Kris Miller Due Wednesday, April 21 before 8:00pm by web turnin. ------------------------------------------------------------------------------- Turnin: Turnin this assignment to the folder, hw3, using the electronic turnin linked to from the class webpage. For homeworks only, you may turnin .doc (Microsoft Word) or .txt (Notepad) files. You may also turnin the homework as a .cc or .cpp (C++ source) file. Be sure to turn it into the correct folder. At best, you will be penalized 20%. At worst, your homework may not be graded at all. ------------------------------------------------------------------------------- Note: Collaboration policy for this homework assignment Collaboration on this homework is strongly ENCOURAGED. The homework is intended for practice, not assessment -- most people who turn in decent work should get most if not all points for this assignment. Forming study groups is strongly encouraged. You shouldn't simply copy answers from any source -- each other, the book, the web, other books, previous solutions, etc. But you can certainly discuss how to solve the problems, look over each others solutions and help "debug" them, compare answers and redo problems if you determine your answer is wrong, and most importantly, explain concepts related to the problems and solutions. ------------------------------------------------------------------------------- 0. For 1 point bonus (20%), enter the names (first and last name) of the CS10 students you collaborated on this homework with. 1. What is the output of the following code fragment? int x = 20; while (x > 10) { x = x - 5; cout << x << endl; } cout << x << endl; 2. Rewrite the while loop from above so that the code fragment outputs the following: 20 15 10 3. Self-test Exercise #2-30 (Chapter 2, Exercise #30) 4. Self-test Exercise #2-31 5. Self-test Exercise #2-33 6. CodeMate Programming Project #9 (Chapter 2) 7. Self-test Exercise #2-34 8. Self-test Exercise #3-2 (Chapter 3, Exercise #2) 9. Self-test Exercise #3-5 10. Self-test Exercise #3-6