CS115 Study Guide - Midterm Guide: Substring, Justice Of The Peace, Data Definition Language

315 views15 pages
elliehaj0807 and 36989 others unlocked
CS115 Full Course Notes
13
CS115 Full Course Notes
Verified Note
13 documents

Document Summary

Cs 115 sos review package midterm (define x 4) (define x 5) (define x 5) (define (f x) (* x x)) (define (g y z)(* (+ y z)(* y y))) Dylan schnute (tutor) dylan. schnute367@gmail. com. Erin vanderstoep (coordinator) evanders@uwaterloo. ca. General format: (define (function_name parameter1 parameter2 )(function_expression)) Ex. (define v (* 4 2 x)) ; if we type in v, we would get 32. Rules when defining constants: you cannot define the same variable name twice, scheme keeps track of variables. A step by step simplification of a scheme function by applying substitution rules. Remember to take one step at a time. Example 1: (define (square x y)(+ (* x x) (* y y))) Using the above definition, trace: > (+ (* 3 3) (* 12 12)) ; substitute all parameters into the function at once. The design recipe is a key component of cs 115. If the function squarepower takes in a number and squares it, write:

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

Related Documents