election

election - ; The first three lines of this file were...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
;; The first three lines of this file were inserted by DrScheme. They record metadata ;; about the language level of this file in a form that our tools can easily process. #reader(lib "htdp-beginner-reader.ss" "lang")((modname election) (read-case- sensitive #t) (teachpacks ((lib "image.ss" "teachpack" "htdp"))) (htdp-settings #(#t constructor repeating-decimal #f #t none #f ((lib "image.ss" "teachpack" "htdp"))))) ;; Ru Wang 20319247 CS 135 section 001 tut 108 ; ;; Question 3: Election ; ;; part a ; ;; Contract: ;; party->leader: symbol -> string ; ;; Purpose: the program outputs a string of the leader's name when user inputs the party name in symbol. p ;; Examples: (party->leader 'Bloc) => "Gilles Duceppe" ;; (party->leader 'Conservative) => "Stephen Harper" ;; (party->leader 'Green) => "Elizabeth May" ;; (party->leader 'Liberal) => "Stephane Dion" ;; (party->leader 'NDP) => "Jack Layton" ;; (party->leader 'Hi) => "Input Error" ; ;; Definition: (define (party->leader symbol) (cond [(symbol=? symbol 'Bloc) "Gilles Duceppe"]
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/21/2010 for the course CS 135 taught by Professor Vasiga during the Fall '07 term at Waterloo.

Page1 / 3

election - ; The first three lines of this file were...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online