Design Recipe Team Challenge! - PowerPoint PPT Presentation

1 / 37
About This Presentation
Title:

Design Recipe Team Challenge!

Description:

Title: Design Recipe Jeopardy Author: Emmanuel Schanzer Last modified by: Emmanuel Schanzer Created Date: 11/2/2006 4:43:35 PM Document presentation format – PowerPoint PPT presentation

Number of Views:37
Avg rating:3.0/5.0
Slides: 38
Provided by: Emmanuel121
Category:

less

Transcript and Presenter's Notes

Title: Design Recipe Team Challenge!


1
Design Recipe Team Challenge!
2
The rules
  1. Every team submits their answer in writing.
  2. Every team can gain points for every question.
  3. Wrong answers are worth 50. Wild guesses and
    blank answers are worth 0!
  4. Each round is worth more money!

3
Design Recipe Steps
  • Step 1 - State the Problem
  • Step 2 - Define the Data
  • Step 3 - Write the Contract
  • Step 4 - Make Examples
  • Step 5 - Take Inventory
  • Step 6 - Code
  • Step 7 - Test

4
100 - Step 2
  • Problem Statement
  • Write a function triple, which takes in a
    number as input and outputs a number three times
    its size.

5
100 - Step 2
Problem Statement Write a function triple,
which takes in a number as input and outputs a
number three times its size.
  • Data Definition
  • Numbers like 20, 567, 0, 18

6
100 - Step 2
  • Problem Statement
  • Youre buying tile for a new bathroom, and you
    must convert the measurements from feet to
    inches. Write a function feet-gtinches which
    takes a length (in feet) and returns a length (in
    inches).

7
100 - Step 2
Problem Statement Write a function feet-gtinches
which takes a length (in feet) and returns a
length (in inches).
  • Data Definition
  • Numbers like 20, 567, 0, 18

8
100 - Step 2
  • Problem Statement
  • Write a function hello, which takes in a name
    as input and prints out Hello, _____ for that
    person, filling in their name.

9
100 - Step 2
Problem Statement Write a function hello, which
takes in a name as input and prints out Hello,
_____ for that person, filling in their name.
  • Data Definition
  • Strings like Rasheem and Vinelle

10
100 - Step 2
  • Problem Statement
  • You go out to dinner and everything is perfect,
    but how much do you tip the waiter? Write a
    function tip, which takes two inputs the cost
    of the meal and the tax. It should return the
    size of the tip. (to calculate tax, take the cost
    of the meal and multiple it by the tax, then
    divide by 100)

11
100 - Step 2
Problem Statement Write a function tip, which
takes two inputs the cost of the meal and the
tax. It should return the size of the tip.
  • Data Definition
  • Numbers like 20, 567, 0, 18

12
100 - Step 2
Problem Statement Write a function circle30,
which takes a color as input, and outputs a solid
circle of the appropriate color. The radius of
the circle must always be 30.
  • Data Definition
  • Strings like red, blue, yellow

13
100 - Step 2
  • Problem Statement
  • Write a function blue-rect, which takes width
    and height as input, and outputs a solid blue
    rectangle of the appropriate size.

14
100 - Step 2
Problem Statement Write a function blue-rect,
which takes width and height as input, and
outputs a solid blue rectangle of the appropriate
size.
  • Data Definition
  • Numbers like 30, 54, 102

15
100 - Step 2
  • Problem Statement
  • 100 is the smallest three-digit number, and 999
    is the biggest. Anything in between these numbers
    is also three digits. Write a function 3digits
    that takes a number as input and returns true
    if the input is more than 100 and less than 999.

16
100 - Step 2
Problem Statement Write a function 3digits that
takes a number as input and returns true if the
input is more than 100 and less than 999.
  • Data Definition
  • Numbers like 30, 574, 102

17
(No Transcript)
18
200 - Step 3
Problem Statement Write a function triple,
which takes in a number as input and outputs a
number three times its size.
  • Data Definition
  • Numbers like 20, 567, 0, 18

ContractPurpose Statement triple Number -gt
Number multiplies the input by 3
19
200 - Step 3
Problem Statement Write a function feet-gtinches
which takes a length (in feet) and returns a
length (in inches).
  • Data Definition
  • Numbers like 20, 567, 0, 18

ContractPurpose Statement feet-gtinches
Number -gt Number converts the input from feet
to inches
20
200 - Step 3
Problem Statement Write a function hello, which
takes in a name as input and prints out Hello,
_____ for that person, filling in their name.
  • Data Definition
  • Strings like Rasheem and Vinelle

ContractPurpose Statement hello String -gt
String takes a name and prints Hello, ltnamegt
21
200 - Step 3
Problem Statement Write a function tip, which
takes two inputs the cost of the meal and the
tax. It should return the size of the tip.
  • Data Definition
  • Numbers like 20, 567, 0, 18

ContractPurpose Statement tip Number Number
-gt Number given a price and a tip percentage,
return the tip amount
22
200 - Step 3
Problem Statement Write a function blue-rect,
which takes width and height as input, and
outputs a solid blue rectangle of the appropriate
size.
  • Data Definition
  • Numbers like 30, 54, 102

ContractPurpose Statement blue-rect Number
Number -gt Image draws a blue rectangle of the
correct size
23
200 - Step 3
Problem Statement Write a function 3digits that
takes a number as input and returns true if the
input is more than 100 and less than 999.
  • Data Definition
  • Numbers like 30, 574, 102

ContractPurpose Statement 3digits Number -gt
Boolean returns true if the input has 3 digits
24
(No Transcript)
25
300 - Step 4
Problem Statement Write a function triple,
which takes in a number as input and outputs a
number three times its size.
  • Data Definition
  • Numbers like 20, 567, 0, 18

ContractPurpose Statement triple Number -gt
Number multiplies the input by 3
Examples (triple 5) gt 15
26
300 - Step 4
Problem Statement Write a function feet-gtinches
which takes a length (in feet) and returns a
length (in inches).
  • Data Definition
  • Numbers like 20, 567, 0, 18

ContractPurpose Statement feet-gtinches
Number -gt Number converts the input from feet
to inches
Examples (feet-gtinches 6) gt 75
27
300 - Step 4
Problem Statement Write a function hello, which
takes in a name as input and prints out Hello,
_____ for that person, filling in their name.
  • Data Definition
  • Strings like Rasheem and Vinelle

ContractPurpose Statement hello String -gt
String takes a name and prints Hello, ltnamegt
Example (hello Jose) gt hello, Jose
28
300 - Step 4
Problem Statement Write a function tip, which
takes two inputs the cost of the meal and the
tax. It should return the size of the tip.
  • Data Definition
  • Numbers like 20, 567, 0, 18

ContractPurpose Statement tip Number Number
-gt Number given a price and a tip percentage,
return the tip amount
Example (tip 50 20) gt 10
29
300 - Step 4
Problem Statement Write a function blue-rect,
which takes width and height as input, and
outputs a solid blue rectangle of the appropriate
size.
  • Data Definition
  • Numbers like 30, 54, 102

ContractPurpose Statement blue-rect Number
Number -gt Image draws a blue rectangle of the
correct size
Example (blue-rect 10 40) gt
30
300 - Step 4
Problem Statement Write a function 3digits that
takes a number as input and returns true if the
input is more than 100 and less than 999.
  • Data Definition
  • Numbers like 30, 574, 102

ContractPurpose Statement 3digits Number -gt
Boolean returns true if the input has 3 digits
Example (3digits 173) gt true
31
(No Transcript)
32
400 - Step 5
Problem Statement Write a function triple,
which takes in a number as input and outputs a
number three times its size.
ContractPurpose Statement triple Number -gt
Number multiplies the input by 3
Examples (triple 5) gt 15
(define (triple x) function body)
33
400 - Step 5
Problem Statement Write a function feet-gtinches
which takes a length (in feet) and returns a
length (in inches).
ContractPurpose Statement feet-gtinches
Number -gt Number converts the input from feet
to inches
Examples (feet-gtinches 6) gt 75
(define (feet-gtinches f) function body)
34
400 - Step 5
Problem Statement Write a function hello, which
takes in a name as input and prints out Hello,
_____ for that person, filling in their name.
ContractPurpose Statement hello String -gt
String takes a name and prints Hello, ltnamegt
Example (hello Jose) gt hello, Jose
(define (hello name) function body)
35
400 - Step 5
Problem Statement Write a function tip, which
takes two inputs the cost of the meal and the
tax. It should return the size of the tip.
ContractPurpose Statement tip Number Number
-gt Number given a price and a tip percentage,
return the tip amount
Example (tip 50 20) gt 10
(define (tip total percent) function body)
36
400 - Step 5
Problem Statement Write a function blue-rect,
which takes width and height as input, and
outputs a solid blue rectangle of the appropriate
size.
ContractPurpose Statement blue-rect Number
Number -gt Image draws a blue rectangle of the
correct size
Example (blue-rect 10 40) gt
(define (blue-rect x y) function body)
37
400 - Step 5
Problem Statement Write a function 3digits that
takes a number as input and returns true if the
input is more than 100 and less than 999.
ContractPurpose Statement 3digits Number -gt
Boolean returns true if the input has 3 digits
Example (3digits 173) gt true
(define (3digits 543) function body)
Write a Comment
User Comments (0)
About PowerShow.com