-
Notifications
You must be signed in to change notification settings - Fork 0
/
1-9-2.rkt~
29 lines (22 loc) · 990 Bytes
/
1-9-2.rkt~
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
;; 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 1-9-2) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f () #f)))
; A List-of-temperatures is one of:
; – '()
; – (cons CTemperature List-of-temperatures)
(define ABSOLUTE0 -272)
; A CTemperature is a Number greater than ABSOLUTE0.
; List-of-temperatures -> Number
; computes the average temperature
; List-of-temperatures -> Number
; computes the average temperature
(define (average alot)
(/ (sum alot) (how-many alot)))
; List-of-temperatures -> Number
; adds up the temperatures on the given list
(define (sum alot) 0)
; List-of-temperatures -> Number
; counts the temperatures on the given list
(define (how-many alot) 0)
(check-expect
(average (cons 1 (cons 2 (cons 3 '())))) 2)