DrScheme is an IDE (Integrated Development Environment) and interpreter for the Scheme programming language. Information on downloading and installing DrScheme can be found at http://www.drscheme.org.
Make sure you install the latest version from the website. Older versions (even relatively recent ones) can sometimes have significant language differences which will be troublesome later on.
With DrScheme installed on your system (or using a computer in one of the labs), try the following:
speed-of-light
and a function meters->lightyears
which converts a distance in meters to light years (approximately).(define speed-of-light 299792458) ;in m/s (define (meters->lightyears dist) (/ dist (* speed-of-light (* 60 60 24 365.3524))))
Copy and paste the preceding code into the Definitions Window in DrScheme.
t1.scm
.(meters->lightyears 1.85)into the Interactions Window.
Your programming assignments for CS 135 will be submitted electronically. The details of how to do this (and much more useful information) can be found in the Style Guide for Assignments. The easiest method is probably to use Odyssey, an online graphical interface to your UNIX account at https://www.student.cs.uwaterloo.ca/odyssey/.
You will get practice submitting files in Assignment 0. Always be careful about what folders you put your solution files in and what you call your files, especially if you use Odyssey. Don't wait until the last moment to submit!
(define (f x) (- (* 5 x) 4))
⇒f(x) = ???(define (g x) (- (/ (* (+ x 2) (- x 3)) 5) x))
⇒g(x) = ???(- (* 4 5) (/ 6 3))
(/ (+ 2 (- 5 2) (* 3 3)) (/ (- (* 5 5) 4) 3))
(define (f x) (* x (+ x 1))) (+ (f 1) (/ (f 2) 3))
(define (f x) (- x 1)) (define (g x) (* x (f (/ x 3)) 2)) (/ (g (g 6)) 2)
This file generated Monday, December 17th, 2007 using PLT Scheme and WebIt!