tutorial02

# tutorial02 - CS 135 Winter 2012 Tutorial the Second CS 135...

This preview shows pages 1–6. Sign up to view the full content.

CS 135 - Winter 2012 Tutorial the Second January 18, 2012 CS 135 Winter 2012 02: Tutorial the Second 1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Clicker Question - Stepping Go to this URL https://www.student.cs.uwaterloo.ca/ cs135/stepping and complete Practice Problem 3. How many arrows = (how many steps) are on the completed page? A 4 B 5 C 6 D 7 E 8 CS 135 Winter 2012 02: Tutorial the Second 2
Posn structures constructor function make-posn , with contract ;; make-posn: Num Num Posn selector functions posn-x and posn-y , with contracts ;; posn-x: Posn Num ;; posn-y: Posn Num CS 135 Winter 2012 02: Tutorial the Second 3

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Example: ( define mypoint ( make-posn 8 1 )) ( posn-x mypoint ) 8 ( posn-y mypoint ) 1 Possible uses: coordinates of a point on a two-dimensional plane positions on a screen or in a window a geographical position CS 135 Winter 2012 02: Tutorial the Second 4
Group Problem - my-equal? Write a predicate: my-equal?: ( union Symbol Num Posn ) ( union Symbol Num Posn ) Boolean that produces true if the two arguments are equal and otherwise false . You

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern