Lecture Summaries - Week 9
Jump To:
[Lecture Index |
Previous Week's Lectures |
Next Week's Lectures]
Topics covered:
- Summary of incremental program development.
- A methodology for dealing with bugs.
- Locate your mistaken assumption by explaining how the
program behaved as it did.
- Fix it by making the assumption true or rewriting
the code to relax that assumption.
- A review of how to write functions.
- What makes a good user interface (flexibilty, error detection,
and error notification).
- An example of applying these techniques to give the checkbook
balancing program a nice interface.
- Add allowing leading blanks
(fcb1.c).
- Finding and fixing a bug in handling bad transaction codes
correctly
(fcb2.c).
- Fixing one transaction to print errors if bad
(fcb3.c).
- Fixing the remaining transactions
(fcb4.c).
- The null statement.
- Simplifying our checkbook program.
(fcb5.c).
Reading: Chapter 6.6 (pages 140-141)
Topics covered:
- Why we need to store collections of data.
- What arrays and array elements are.
- How we declare array variables and use array indexes.
- Why variable array indexes are so useful.
- How we "traverse" arrays.
- An example of zeroing out all array elements, assigning some
values, and then printing the array
(arrayex.c).
- How we read array elements.
- A methodology for writing array-traversing code.
- Why many other problems require arrays.
- An example of printing out scores larger than the average
(arrayavg.c).
Reading: Chapter 7.1
Topics covered:
- Passing array parameters to functions.
- How to write functions that can handle a single size of array.
- An example function to print an array of 10 elements
(print10.c).
- How to extend these functions to handle any size array.
- An example function to print an array of any number of elements
from front to back
(printfor.c).
- And an example printing from back to front
(printback.c).
- How array parameters are not copies but names.
- An example program to verify that changing an array parameter
changes the value you in the caller
(testparm.c).
- An example function to read in an array of values
(readem.c).
- How writing functions that manipulate arrays makes life easy.
- Our input-reversal program redone using functions.
(inputrev.c).
- Why we have to be very careful not to let array indices get out
of range.
Reading: Chapter 7.2.
[EE150 Home Page |
Top Of Page]