a4q3 - ; The first three lines of this file were inserted...

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-intermediate-lambda-reader.ss" "lang")((modname a4q3) (read-case- sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f ()))) ;; CS 116 Assignment 4 Question 3 ;; r46wang 20319247 (define-struct movie-info (title genre rating)) (define-struct best-movies (first second third)) ;;pre-defined movie-info for easier testing: (define r10 (make-movie-info "apple" 'fantasy 10)) (define r9 (make-movie-info "banana" 'action 9)) (define r8 (make-movie-info "cat" 'comedy 8)) (define r7 (make-movie-info "dare" 'action 7)) (define r6 (make-movie-info "eggs" 'drama 6)) (define r5 (make-movie-info "friends" 'drama 5)) (define r4 (make-movie-info "great" 'fantasy 4)) (define r3 (make-movie-info "hilarious" 'comedy 3)) (define r2 (make-movie-info "intelligence" 'action 2)) (define r1 (make-movie-info "janitor" 'drama 1)) ;;top-3: (listof movie-info) -> best-movies ;; produces a best-movies structure that contains the 3 movies that have the
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 116 taught by Professor T.vasiga during the Fall '09 term at Waterloo.

Page1 / 2

a4q3 - ; The first three lines of this file were inserted...

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