03-separation_of_concerns

03-separation_of_concerns - Computer Science 136: David R....

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Computer Science 136: David R. Cheriton School of Computer Science Elementary Algorithm Design and Data Abstraction Winter 2012 Lecture 3 Separation of Concerns Separate code which implements functionality from code which uses functionality. How should the appropriate functionality (functions, data) be described? CS 136 Winter 2012 03 Separation of Concerns 1/1 Topics from Last Time I/O: printf , read Side-effects: begin Mutation for Memory, set! Passport office example, Encapsulation CS 136 Winter 2012 03 Separation of Concerns 2/1 Aside Communicating by e-mail as a University of Waterloo student: Reply-to field should include your full name (given name and family name in that order) in the English alphabet Reply-to address should be your uwaterloo.ca address Forward your uwaterloo.ca address as needed Give people the tools they need to help you: Quest login, student number CS 136 Winter 2012 03 Separation of Concerns 3/1 Assignment 1 Problem 1. File a1p1.rkt Write a module in Racket that displays the sum of the integers between 1 and 10, inclusive. Your module must be in a file named a1p1.rkt (all lower case). To test your solution prior to submission, create and run the following client module: ;; Test module for a1p1.rkt ;; The number 55 should be displayed #lang racket ( require "a1p1.rkt") CS 136 Winter 2012 03 Separation of Concerns 4/1 Assignment 1 Problem 2. File: playgame.rkt Write a module in Racket that plays a simple guessing game. The guessing game is implemented by a module game.rkt that will be supplied in the Marmoset environment. The interface for game . rkt is as follows: ;; Implementation of simple guessing game ;; Provides: startgame, guess ;; (startgame n) starts a new game in which the ;; game [this module] chooses a secret integer ;; between 1 and n, and you [the client module] ;; try to guess it [[STARTGAME PRODUCES (void)]] ;; (guess x) consumes an integer x and produces ;; either right or wrong, depending on whether ;; or not x is the secret integer CS 136 Winter 2012 03 Separation of Concerns 5/1 Assignment 1 Problem 2 contd. File:Assignment 1 Problem 2 contd....
View Full Document

This note was uploaded on 02/22/2012 for the course CS cs136 taught by Professor Cormack during the Winter '10 term at Waterloo.

Page1 / 18

03-separation_of_concerns - Computer Science 136: David R....

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online