;; The first three lines of this file were inserted by DrRacket. 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 01learning) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f ()))) ;; DEMO: comparing learning capacity hours (define weeks/semester 13) ;; length of Tufts semester (define minutes/week 150) ;; instructional minutes in one class ;; Analysis of the data: ;; 0 20 ;; |------------------+----------------> ;; FULL LEARNING 60% LEARNING ;; learning : number -> number ;; given an actual number of class minutes, returns equivalent learning capacaity min (define (learning actual-minutes) (cond [(and (<= 0 actual-minutes) (<= actual-minutes 20)) actual-minutes] [(> actual-minutes 20) (+ (* .60 (- actual-minutes 20)) 20)])) (check-expect (learning 100) 68) (check-expect (learning 0) 0) (check-expect (learning 20) 20) (check-expect (learning 10) 10) ;; wish list: change minutes to hours ;; minutes->hours : number of minutes -> number of hours ;; returns a number of hours equivalent to the given number of minutes (define (minutes->hours min) (/ min 60)) (check-expect (minutes->hours 60) 1) ;; equiv-learning-minutes : minutes -> minutes