Date | In Class | Readings | Assignments |
8/29 | Review syllabus. Paper. Program phases. Converting feet to inches. Trace. Area of a rectangle. | Ch1, sections 1.1-1.3 and Ch2, section 2.1. Start the rest of Ch2 if you have time. The caution on p. 18 does not apply to us. | |
9/1 | Equivalent code for rect.cpp: rectalt.cpp. Area of a rectangle with user input: rect2.cpp, rect2a.cpp, with file output: rect3.cpp. Programming steps. | Finish reading Ch2. | Ch2 exercises 1-6 (due 9/8 via email, soln). Lab exercises (don't hand in): 1, 2, 3, 4. |
9/3 | Meet in lab (Mac 101). You may wish to bring laptops and install the compiler. Using DevC++ | Review Ch2. Begin Ch3 if time. | Bring questions on end-of-chapter assignments. |
9/5 | Begin Ch3. wraparound. Floating point: flt.cpp. Mixed mode: 1, 2. Integers: 1, 2, 3. | Ch3, sections 3.1-3.7. | Ch2 exercises due Monday. Ch3 exercises 1, 4, 5, 7, 8, 9, 11, 14-17 (don't hand in, soln) |
9/8 | assn1m.cpp. Adding 1 to a variable. Using a constant. Characters: ASCII table, conversion. | Ch3 lab exercises (don't hand in): 1, 2, 3, 4, 5, 6, 7. | |
9/10 | Finish Ch3. Loops: 1, 2, 3, 4. Errors. | Begin Ch4. | Ch4 exercises 1-10, 14, 17, 19 (don't hand in, soln, Problem 19). Lab exercises: 1, 2, 3, 4, 5, 6 7. |
9/12 | Selection: 0, 1, 2, 3, 4, float.cpp, semicolons. | Finish Ch4 reading. | |
9/15 | Nesting within if: 0, 1, 2, 3, 4. What would be involved in Ch 4, problem 22? (if, switch). | How do the steps in section 4.6 apply to this week's program? | Article 1 due Wednesday |
9/17 | Article 1
topics.
Where are we? Functions. Value returning: 1, 2. Local variables: 1, 2. |
Ch5, sections 5.1-5.3. 5.1 is less important than 5.2 and 5.3. | Ch5 problems: 8, 10a-g. Code for #10. |
9/17 | Void functions: 1. Side effects 1, 2, 3. | Ch5, section 5.4, 5.5. | Quiz on Ch 4 Monday. |
9/22 | Value returning vs. void: 1, 2 . Stars: 1, 2, 3, 4, 5. | Ch5, section 5.6. | Ch5 lab exercises (don't hand in): 1, 2, 3 |
9/24 | More functions. date1.cpp, date2.cpp. Loan problem. Using function stubs to solve it: 0, 1, 2. | Ch5, section 5.7. | |
9/26 | Loan: 3, 4. Libraries: loan5.cpp, loan.h. Random numbers: rnd.cpp, roll.cpp. | Ch5, section 5.8, 5.9. | |
9/29 | Meet in lab to do this exercise (solution). Extra time: Code for #10 (solution). | Try but don't hand in: convert today's exercise to a library. Solution: driver, library | |
10/1 | How would you convert rand() to a number between 0 and 1? Interesting try. rand1.cpp, rand2.cpp, rand3.cpp. | ||
10/3 | Strings. pay.cpp. Form letters using strings: 1, 2. 3. Madlibs 1, 2 | Ch6: 6.1, 6.2, 6.3, 6.5 | Ch6: 1, 2, 4, 5, 7, 9 (not to hand in). Code for 5, 7, 9). Ch6 lab exercises: 1, 2, 3, 4. |
10/6 | Exam 1 comments, sample, answers, prog11.cpp. 2008: answers, prog11_08.cpp, comments. | ||
10/8 | Loops. Review: sum1.cpp, Counting: 1, 2, with for, 3, with for. | Ch 7.1-7.3. | Ch 7 problems (don't hand in): 1, 2, 7, 8, 10 (code for 2). |
10/10 | Using chars as loop counters: 1,
2. Infinite loops: 1,
2.
Adding just the positive numbers: sum2.cpp. Finding an average: avg1.cpp. Of just positive numbers: avg2.cpp. The max of a sequence of numbers: 1, 2. |
7.4-7.7. | Ch7 lab exercises: 1, 2, 3, 4. |
10/15 | Do: do.cpp,
findsum1.cpp. Using a sentinal: findsum2.cpp, maxt.cpp. Discussion of example of p165. outline, code and assignment 7. |
7.8, 8.1 (you may skip Ulam's conjecture). | Ch8: 1-4, 5(opt), 7, 12 |
10/17 | Debugging. Ch 8, more general loops: over1000.cpp, Compound interest: problem, code. Error trapping: receipt2.cpp. How would you produce these? (nested loops). Rows of stars: 1, 2, using a function. |
8.2, 8.5. Optional: 8.3, 8.4. Skip 8.6. | Ch8: 1-4, 5(opt), 7, 12. code for 5, 7. |
10/20 | Averaging grades: 1, 2, 3, 4, 5. Nested loop exercise (ans, using while) | Begin Ch 9. We will cover 9.1-9.6. | Ch 9 problems: 1-5, 7, 8 . |
10/22 | Article 2 due. Recall loan problem from 9/24: value versus reference parameters. Comparison. Choosing an activity: plan, stub, code. | Think about for Friday: rewrite assn7.cpp using functions. | |
10/24 | Using break; Campaign letter: plan, code. fout as a parameter. Rewrite assn7.cpp using functions. | Begin Ch 10. We will cover 10.1, 10.2, 10.3, 10.5 and skim 10.6. | For Monday (not to hand in): functions (ans). |
10/27 | Section 10.1: documenting in/out.
What functions would you use for assn8.cpp? |
Read 11.1-11.4 | Ch10 problems: 1,3,4. Steps 1 and 2 of calendar due Wednesday. |
10/29 | Section 10.3: Overloading.
Section 10.5: Swap integers,
strings,
with a template.
max with a template.
Section 10.6. |
Read 11.5-11.8 (skip 'Updating a File') | More parameter exercises: a, b. |
10/31 | Science Colloquium:
One of the optional identifications on Exam 2 will ask about this.
Start Chapter 11. Section 11.3: file input. rect7.cpp. Checking for nonexistent file. Processing a file: knowing the size, using a header, using eof (Section 11.4). Checking for whitespace at end of file: 1, 2. |
11.5-11.8 (skip 'Updating a File'), 12.1, 12.2. | Ch 11 problem: 1. Ch 12 problems 1, 2. |
11/2 | Input from a file or keyboard. Entering the file name Updating a file Using switch for menu-driven programs: 1, 2. |
13.1, 13.2. | File exercise (sol) |
11/4 | Arrays: simple uses. As parameters. Using const. Exercise: convert the rest of the last example to functions (sol). variable number of scores. | We are not following the text sections 13.3-13.8. | |
11/6 | Initializing with declaration. Using an array to count. Bubblesort. What's wrong with this? | We will not read Chapter 14, but will use the bubblesort code. | |
11/10 |
In class: 1. Convert the rest of this to functions (sol). 2. Exercise candnams.dat, votes.dat , code 1. Email me what you have done by the end of class. |
Think about this problem for Wednesay. | |
11/12 | CS 132. Nov 10 exercises comments. Parallel arrays: problem, scores.dat, skeleton code: 0, 1, 2, code. | ||
11/14 | No class, I will be at a conference. | ||
11/17 | Structs: emp.cpp, hierarchical structs. An array of records: 1. | Ch 17: 17.1-17.2. | Ch 17 problems: 1, 2 (replace 'vector' with 'array'). |
11/19 | Meet in lab to do this exercise. data, ans a, b. Exercise with a menu(ans). | Can you build the half aphorism at the bottom from 1 and 2? | |
11/21 | 11/19 comments. highest.cpp redone using records. Building the half aphorism at the bottom from 1 and 2? With parallel arrays and records. In JavaScript. What about this? | Don't forget the book report! | |
11/24 | Exam 2. Previous exam 2, solutions, program 8. This year 1-7, program 8. | ||
12/1 | A doubly subscripted array (ans). Another doubly subscripted array. | ||
12/3 | Meet in lab: warehouse exercise, Code skeleton. Solution. | ||
12/5 | How would you represent images? Recursion. Factorial: 1, 2. How is the Towers of Hanoi recursive? | ||
12/8 | How is the Towers of Hanoi recursive? towers.cpp. Sample final questions. | ||
12/10 | Ans to questions on 12/3. Final thoughts. | ||
12/11 | 12/11, 1-2:30 pm: MPS Senior thesis proposals in Mac 121. Lunch at 12:30. | ||
12/15 | Final exam at 9 am Monday. exam, sample (ans). |