Blob


1 ;; The first three lines of this file were inserted by DrScheme. They record metadata
2 ;; about the language level of this file in a form that our tools can easily process.
3 #reader(lib "htdp-intermediate-reader.ss" "lang")((modname |22.2|) (read-case-sensitive #t) (teachpacks ((lib "draw.ss" "teachpack" "htdp") (lib "arrow.ss" "teachpack" "htdp"))) (htdp-settings #(#t constructor repeating-decimal #f #t none #f ((lib "draw.ss" "teachpack" "htdp") (lib "arrow.ss" "teachpack" "htdp")))))
4 Exercise 22.2.1. Define an abstraction of the functions convertCF and names from section 21.1 using the new recipe for abstraction. Solution
6 map
8 ;convertFC : (listof number) -> (listof number)
9 ;Converts a list of Fahrenheit measurements to a list of Celsius measurements
12 (define (convertFC lon)
13 (map F->C lon))
14 (define (F->C t)
15 (* 5/9 (- t 32)))
16 (convertFC lon)