CPSC 110 Lecture : CPSC lecture 2.docx

52 views2 pages
28 Aug 2014
School
Course
Professor
ferrari12 and 39375 others unlocked
CPSC 110 Full Course Notes
23
CPSC 110 Full Course Notes
Verified Note
23 documents

Document Summary

Use ;; for permanent comments, use ; for temporary comments. Signature must look like ;; number -> number , i. e. upper-cased word, space, arrow, space, upper-cased word. To comment out an entire section, use #; If function produces a boolean, function name ends in question mark ( ? ) Q: design a function called yell that consumes strings like hello and adds ! to produce strings like hello! . (see lecture2. rkt) Htdf: (how to design functions recipe: signature, purpose, stub, run the program and see if there are errors, define examples, wrap each in check-expect, template and inventory, code function body, test and debug. ;; purpose: add ! to the end of the string consumed s. ;; define examples and check errors (check-expect (yell hello) hello!) (check-expect (yell ) !) (check-expect (yell bye) (string-append bye !)) ;; ( s)) (define (yell s) (string-append s !))

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers