Laboratory Exercises For Computer Science 151

Format for Required Laboratory Write-ups

Format for Required Laboratory Write-ups

CSC 151 requires students to turn in various laboratory exercises. While the first required lab (exercise 3) has special expectations, write-ups for all subsequent laboratory exercises should utilize the following formatting conventions:


Example:

The following is a possible write-up for a lab which had questions taken from Exercises 1.6ace and 1.7 from the textbook.

;;; Henry M. Walker
;;; Box Y-02
;;; Sample Lab 1:  Format for Required Laboratory Write-ups

;;; Exercise 1.6ace from Springer-Friedman

;; part a
(cons 'one (cons 'two (cons 'three (cons 'four '()))))

;; testing:

> (cons 'one (cons 'two (cons 'three (cons 'four '())))) 
    ===> (one two three four)

;; part c
(cons 'one (cons (cons 'two (cons 'three '())) (cons 'four '())))
;; testing:

> (cons 'one (cons (cons 'two (cons 'three '())) (cons 'four '())))
    ===> (one (two three) four)

;; part e
(cons (cons (cons 'one '()) '()) '())

;; testing:

> (cons (cons (cons 'one '()) '()) '())
    ===> (((one)))

;;; Exercise 1.7 from Springer-Friedman

;The cons procedure is commonly used to insert an additional element 
;at the head of a list.  In this exercise, A is a value and ls is a 
;list of n elements.  Thus, (cons A ls) creates a list of n+1 
;elements:  A is first on this new list, with the elements of ls 
;following.

This document is available on the World Wide Web as

http://www.math.grin.edu/~walker/courses/151.sp99/lab-format.html

created January 28, 1999
last revised January 28, 1999

Henry M. Walker (walker@cs.grinnell.edu)