![]() |
![]() |
|
home—info—lectures—exams—hws—archive
Which languages might be involved in
setting up an on-line
order system, for a store?
(Feel free to chat with people who have taken
Software Engineering.)
Which of the five example programs above is most “typical” do you think, of the sort of programs most programmers tend to work on?
; subst: atom atom (list-of atom) → (list-of atom)) ; (define (subst old new data) ...) (check-expect (subst 'apple 'zinger (list 'apple 'banana)) (list 'zinger 'banana)) (check-expect (subst 'apple 'zinger (list 'cherry 'banana)) (list 'cherry 'banana)) (check-expect (subst 'apple 'zinger (list 'apple 'banana 'apple 'kiwi 'apple)) (list 'zinger 'banana 'zinger 'kiwi 'zinger)) ;; PROVIDE AT LEAST TWO ADDITIONAL TEST CASES (which can be simpler than the above) ;; Note: 'list' vs 'cons': ;; (list 'a 'b 'c) ;; returns ;; (cons 'a (cons 'b (cons 'c empty))). ;; These two functions are related *but different*; ;; `list` tends to be useful for test-cases, while `cons` is usually what ;; you want inside your code. |
1 Short correct answers get more credit than long correct answers; use a single word when possible. ↩
home—info—lectures—exams—hws—archive
©2009, Ian Barland, Radford University Last modified 2009.Feb.14 (Sat) |
Please mail any suggestions (incl. typos, broken links) to ibarland ![]() |
![]() |