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 question 8 of lab 2.

;;; Henry M. Walker
;;; Box Science II
;;; Sample Lab 2:  Format for Required Laboratory Write-ups

;;; Step 8

(modulo (truncate 12345.6789) 10)
;; returns 5.0, because 
;;      (truncate 12345.6789) removes digits to the right of the decimal
;;              point -- yielding 12345.0 -- and
;;      (modulo 12345.0 10) gives the remainder when dividing 12345.0 by 10

(modulo (truncate (/ 12345.6789 10)) 10)
;; returns 4.0, because
;;      (/ 12345.6789 10) shifts the decimal point left one place
;;              giving 1234.56789
;;      (truncate (/ 12345.6789 10)) or (truncate 1234.56789) removes
;;              digits to the right of the decimal place -- giving 1234.0
;;      (modulo 1234.0 10) gives the remainder when dividing 1234.0 by 10

                
;; To extract the thousands digit of 12345.6789, first move the decimal
;; point to immediately after the 2, truncate, and look at a remainder:

(modulo (truncate (/ 12345.6789 1000)) 10)



This document is available on the World Wide Web as

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

created January 28, 1999
last revised August 26, 2000

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