;; 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 15.1.4) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor mixed-fraction #f #t none #f ()))) ; Worked exercise 15.1.4 ; reply : string ("good morning", "good afternoon", or "good night") -> ; string ("I need coffee", "I need a nap", or "bedtime!") (check-expect (reply "good morning") "I need coffee") (check-expect (reply "good afternoon") "I need a nap") (check-expect (reply "good night") "bedtime!") (define (reply greeting) (cond [(string=? greeting "good morning") "I need coffee"] [(string=? greeting "good afternoon") "I need a nap"] [(string=? greeting "good night") "bedtime!"] ))