Functional Problem Solving (CSC 151 2014F) : EBoards

CSC151.01 2014F, Class 08: Documenting Programs and Procedures


Overview

Preliminaries

Admin

Upcoming Work

Extra Credit Opportunities

Academic

Peer Support

Questions

Debrief on procedures lab

What are the key concepts you learned in the reading/lab?

What were the more difficult aspects of the reading/lab?

What else would you like to know about (with regards to proc)?

The need for documentation

The Six P's

Practice

    ;;; Procedure:
    ;;;   max
    ;;; Parameters:
    ;;;   x, a number
    ;;;   y, a number
    ;;; Purpose:
    ;;;   Find the greatest value in the set (x,y),
    ;;; Produces:
    ;;;   greatest, a number
    ;;; Preconditions:
    ;;;   Neither x nor y is imaginary.
    ;;; Postconditions:
    ;;;   greatest >= x
    ;;;   greatest >= y
    ;;;   greatest is one of (x,y)

    ;;; Procedure:
    ;;;   max
    ;;; Parameters:
    ;;;   x1 ... xn, two or more real numbers
    ;;; Purpose:
    ;;;   Find the greatest value in the set [x1 ... xn]
    ;;; Produces:
    ;;;   greatest, a number
    ;;; Preconditions:
    ;;;   [No additional]
    ;;; Postconditions:
    ;;;   greatest >= xi, for any i.
    ;;;   greatest is an element of [x1 ... xn]