;; 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-intermediate-lambda-reader.ss" "lang")((modname l05interface) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f () #f)))
;; Q1
(define (classify-by-pH P type)
...)
;; Q2
(define (good-differences L)
...)
(define (sum-good-differences L)
...)
;; Q3
;; (div3? n) return #true if n is divisible by 3, otherwise #false.
;; div3?: Int -> Bool
(define (div3? n) (= 0 (remainder n 3)))
;; (cube x) return the cube of x.
;; cube: Int -> Int
(define (cube x) (* x x x))
;; (cube-threes L) cube each value in L that is divisible by 3
;; cube-threes: (listof Int) -> (listof Int)
;; Example:
(check-expect (cube-threes (list 0 2 3 4 5 6 7)) (list 0 27 216))
(define (cube-threes L)
(map cube (filter div3? L)))
;; Q4
(define (leap-year? year)
...)
(define (keep-leapyears L)
...)