Blame


1 12687dd9 2023-08-04 jrmu ;; The first three lines of this file were inserted by DrScheme. They record metadata
2 12687dd9 2023-08-04 jrmu ;; about the language level of this file in a form that our tools can easily process.
3 12687dd9 2023-08-04 jrmu #reader(lib "htdp-beginner-reader.ss" "lang")((modname 3.3.6) (read-case-sensitive #t) (teachpacks ((lib "convert.ss" "teachpack" "htdp"))) (htdp-settings #8(#t constructor repeating-decimal #f #t none #f ((lib "convert.ss" "teachpack" "htdp")))))
4 12687dd9 2023-08-04 jrmu ;; Celsius->Fahrenheit : number -> number
5 12687dd9 2023-08-04 jrmu ;; Computes the Fahrenheit temperature given the Celsius temperature
6 12687dd9 2023-08-04 jrmu
7 12687dd9 2023-08-04 jrmu (define (Celsius->Fahrenheit Celsius)
8 12687dd9 2023-08-04 jrmu (+ (* 9/5 Celsius) 32))
9 12687dd9 2023-08-04 jrmu
10 12687dd9 2023-08-04 jrmu ;; Fahrenheit->Celsius : number -> number
11 12687dd9 2023-08-04 jrmu ;; Computes the Celsius temperature given the Fahrenheit temperature
12 12687dd9 2023-08-04 jrmu
13 12687dd9 2023-08-04 jrmu (define (Fahrenheit->Celsius Fahrenheit)
14 12687dd9 2023-08-04 jrmu (* 5/9 (- Fahrenheit 32)))
15 12687dd9 2023-08-04 jrmu
16 12687dd9 2023-08-04 jrmu ;; I : number -> number
17 12687dd9 2023-08-04 jrmu ;; to convert a Fahrenheit temperature to Celsius and back
18 12687dd9 2023-08-04 jrmu (define (I f)
19 12687dd9 2023-08-04 jrmu (Celsius->Fahrenheit (Fahrenheit->Celsius f)))