CPS 1 - Spring, 1997 - Ramm 2/19/97 #15
- Announce
- Quiz Today
- Midterm Exam Next Wednesday
Chapter 3. Numerical Computation and a Study of Functions
- Simple Program to read into array and print out
- Size of Array (bigger than needed)
- Keeping track of actual amount of data
- Using a Sentinel for loop control
inout.pas
- Do More:
- Print out in reverse order
- Statistics: Mean, Max, and Min
- Counting and Summing select items in a list
inout2.pas
Chapter 4. Top Down Programming, Subroutine, & a Database Application
- Motivation for Subroutines/Procedures
And it will all happen again ... (part 2)
- Another Major Gain in Productivity
- Tool Building
- Extending the Language
- Using a Procedure
- procedurename(parm1, parm2, ...);
- "CALL" procedurename; {other languages}
- Using functions
- Use of Procedures in Top-Down Design
- Writing a "Trivial" Procedure
- "leave space"
- "copyright notice"
- Adding Flexibility and Power with Parameters
- copyright with name
- copyright with name and date
- Formal Parameters/Arguments
- by position, not name
- names may or may not match
- types must match
- number of parameters must match
- Procedure With Loop
diamond.pas