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

Info iconThis preview shows page 1. 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 a4q2) (read-case- sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f ()))) ;; CS 116 Assignment 4 Question 2 ;; r46wang 20319247 ;;find-between: (listof num) int int num -> int ;;finds the number of targets appear within the bounded position start and stop-1 in the list of numbers. ;;Example: ;;(find-between empty 1 3 2) => 0 ;;(find-between '(1 2 3) -1 5 2) => 0 ;;(find-between '(1 2 3) 6 -1 2) => 0 ;;(find-between '(1 2 3) 2 2 2) => 0 ;;(find-between '(1 2 3) 2 1 2) => 0 ;;(find-between '(1 2 3 4 5) 0 5 8) => 0 ;;(find-between '(1 1 1 1 1 1 1 1 1 1) 0 8 1) => 8 ;;(find-between '(1 1 1 1 1 1 1 1 1 1) 2 12 1) => 8 ;;(find-between '(1 2 0 2 -1 4 8 2) 0 8 2) => 3 ;;(find-between '(1 2 0 2 -1 4 8 2) 1 3 2) => 1 (define (find-between nums start stop target)
Background image of page 1
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.

Ask a homework question - tutors are online