CS115 Study Guide - Midterm Guide: Calendar Date, Wrapper Function, Substring

54 views3 pages
elliehaj0807 and 36989 others unlocked
CS115 Full Course Notes
13
CS115 Full Course Notes
Verified Note
13 documents

Document Summary

Design recipe: contract, purpose, examples, body, tests. Condensed tracing is different from tracing, don"t bother with condensed tracing. (define const1 string ) (define y 12) (define (somef x) (+ (- y x) (sqr x) (max x y) (string-length const1))) (somf 4) (+ (- y 4) (sqr 4) (max 4y) (string-length const1)) (+(-12 4) (sqr 4)(max 4y) (string-length const1))) (+8 16 12 6) (= hello hello ) -> false , equal sign should not be first (+ 3 (* 3(-2))) -> -3 (+3 (* 3(+2))) -> error. Strings: (string-length elbow ) -> 5 (string-append best friend cs )-> bestfriendcs (substring nana 1 3) -> an . Explain: 0 n (1 a 2 n 3) a 4. Cat dog ) = true (check-expect (sqr 4) 16) Check 2 things, and see if they are equal (check-within (* 2 pi) 6. 28 0. 01) Your answer if not exact as the true answer. The answer 6. 28 should be within 0. 01 of the real answer.