Chinaunix首页 | 论坛 | 博客
  • 博客访问: 209230
  • 博文数量: 136
  • 博客积分: 2919
  • 博客等级: 少校
  • 技术积分: 1299
  • 用 户 组: 普通用户
  • 注册时间: 2011-03-11 09:08
文章分类

全部博文(136)

文章存档

2013年(1)

2011年(135)

我的朋友

分类: LINUX

2011-11-18 11:15:40

  1. ;; mht created on Nov 15, 2011

  2. ;; hours->wages : list-of-numbers -> list-of-numbers
  3. ;; to create a list of weekly wages from a list of weekly hours (alon)
  4. (define (hours->wages alon)
  5.   (cond
  6.     [(empty? alon) empty]
  7.     [else (cons (wage (first alon)) (hours->wages (rest alon)))]))

  8. ;; wage : number -> number
  9. ;; to compute the total wage (at $12 per hour)
  10. ;; of someone who worked for h hours
  11. (define (wage h)
  12.   (* 14 h))

  13. ;; hours->wages
  14. (hours->wages (cons 40 (cons 28 empty)))
阅读(153) | 评论(0) | 转发(0) |
0

上一篇:exam9.5.8

下一篇:exam10.1.2

给主人留下些什么吧!~~