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 10.1.1) (read-case-sensitive #t) (teachpacks ((lib "convert.ss" "teachpack" "htdp") (lib "guess.ss" "teachpack" "htdp") (lib "master.ss" "teachpack" "htdp") (lib "draw.ss" "teachpack" "htdp") (lib "hangman.ss" "teachpack" "htdp"))) (htdp-settings #8(#t constructor repeating-decimal #f #t none #f ((lib "convert.ss" "teachpack" "htdp") (lib "guess.ss" "teachpack" "htdp") (lib "master.ss" "teachpack" "htdp") (lib "draw.ss" "teachpack" "htdp") (lib "hangman.ss" "teachpack" "htdp")))))
4 12687dd9 2023-08-04 jrmu (define PAYPERHOUR 12)
5 12687dd9 2023-08-04 jrmu
6 12687dd9 2023-08-04 jrmu Data Definition
7 12687dd9 2023-08-04 jrmu A list-of-numbers is either
8 12687dd9 2023-08-04 jrmu 1. an empty list or
9 12687dd9 2023-08-04 jrmu 2. (cons n lon) where n is a number and lon is a list-of-numbers.
10 12687dd9 2023-08-04 jrmu
11 12687dd9 2023-08-04 jrmu Contract, Purpose, Header
12 12687dd9 2023-08-04 jrmu wage : number -> number
13 12687dd9 2023-08-04 jrmu Computes the wage given hours.
14 12687dd9 2023-08-04 jrmu
15 12687dd9 2023-08-04 jrmu (define (wage hours)
16 12687dd9 2023-08-04 jrmu (* PAYPERHOUR hours))
17 12687dd9 2023-08-04 jrmu
18 12687dd9 2023-08-04 jrmu Contract, Purpose, Header
19 12687dd9 2023-08-04 jrmu hours->wages : list-of-numbers -> list-of-numbers
20 12687dd9 2023-08-04 jrmu Computes the wages (list-of-numbers) from alon.
21 12687dd9 2023-08-04 jrmu
22 12687dd9 2023-08-04 jrmu Template
23 12687dd9 2023-08-04 jrmu
24 12687dd9 2023-08-04 jrmu (define (hours->wages alon)
25 12687dd9 2023-08-04 jrmu (cond
26 12687dd9 2023-08-04 jrmu [(empty?) ...]
27 12687dd9 2023-08-04 jrmu [else ... (first alon) (rest alon) ...]))