Download presentation
Presentation is loading. Please wait.
Published byRose Webb Modified over 9 years ago
2
Design Recipe Team Challenge!
3
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! The rules
4
Design Recipe Steps Step 1 - State the Problem Step 2 - Define the DataDefine the Data Step 3 - Write the ContractWrite the Contract Step 4 - Make ExamplesMake Examples Step 5 - Take InventoryTake Inventory Step 6 - Code Step 7 - Test Step 1 - State the Problem Step 2 - Define the DataDefine the Data Step 3 - Write the ContractWrite the Contract Step 4 - Make ExamplesMake Examples Step 5 - Take InventoryTake Inventory Step 6 - Code Step 7 - Test
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. Problem Statement Write a function ‘ triple ’, which takes in a number as input and outputs a number three times its size.
6
Data Definition: Numbers like 20, 567, 0, 18 Data Definition: Numbers like 20, 567, 0, 18 Problem Statement Write a function ‘ triple ’, which takes in a number as input and outputs a number three times its size. Problem Statement Write a function ‘ triple ’, which takes in a number as input and outputs a number three times its size. $100 - Step 2
7
Problem Statement You ’ re buying tile for a new bathroom, and you must convert the measurements from feet to inches. Write a function “ feet->inches ” which takes a length (in feet) and returns a length (in inches). Problem Statement You ’ re buying tile for a new bathroom, and you must convert the measurements from feet to inches. Write a function “ feet->inches ” which takes a length (in feet) and returns a length (in inches).
8
Data Definition: Numbers like 20, 567, 0, 18 Data Definition: Numbers like 20, 567, 0, 18 Problem Statement Write a function “ feet->inches ” which takes a length (in feet) and returns a length (in inches). Problem Statement Write a function “ feet->inches ” which takes a length (in feet) and returns a length (in inches). $100 - Step 2
9
Problem Statement Write a function ‘ hello ’, which takes in a name as input and prints out “ Hello, _____ ” for that person, filling in their name. Problem Statement Write a function ‘ hello ’, which takes in a name as input and prints out “ Hello, _____ ” for that person, filling in their name.
10
Data Definition: Strings like “Rasheem” and “Vinelle” Data Definition: Strings like “Rasheem” and “Vinelle” Problem Statement Write a function ‘ hello ’, which takes in a name as input and prints out “ Hello, _____ ” for that person, filling in their name. Problem Statement Write a function ‘ hello ’, which takes in a name as input and prints out “ Hello, _____ ” for that person, filling in their name. $100 - Step 2
11
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) 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)
12
Data Definition: Numbers like 20, 567, 0, 18 Data Definition: Numbers like 20, 567, 0, 18 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. 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. $100 - Step 2
13
Data Definition: Strings like “red”, “blue”, “yellow” Data Definition: Strings like “red”, “blue”, “yellow” 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. 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. $100 - Step 2
14
Problem Statement Write a function ‘ blue-rect ’, which takes width and height as input, and outputs a solid blue rectangle of the appropriate size. Problem Statement Write a function ‘ blue-rect ’, which takes width and height as input, and outputs a solid blue rectangle of the appropriate size.
15
Data Definition: Numbers like 30, 54, 102 Data Definition: Numbers like 30, 54, 102 Problem Statement Write a function ‘ blue-rect ’, which takes width and height as input, and outputs a solid blue rectangle of the appropriate size. Problem Statement Write a function ‘ blue-rect ’, which takes width and height as input, and outputs a solid blue rectangle of the appropriate size. $100 - Step 2
16
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. 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.
17
Data Definition: Numbers like 30, 574, 102 Data Definition: Numbers like 30, 574, 102 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. 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. $100 - Step 2
19
Data Definition: Numbers like 20, 567, 0, 18 Data Definition: Numbers like 20, 567, 0, 18 Problem Statement Write a function ‘ triple ’, which takes in a number as input and outputs a number three times its size. Problem Statement Write a function ‘ triple ’, which takes in a number as input and outputs a number three times its size. $200 - Step 3 Contract+Purpose Statement ; triple : Number -> Number ; multiplies the input by 3 Contract+Purpose Statement ; triple : Number -> Number ; multiplies the input by 3
20
Data Definition: Numbers like 20, 567, 0, 18 Data Definition: Numbers like 20, 567, 0, 18 Problem Statement Write a function “ feet->inches ” which takes a length (in feet) and returns a length (in inches). Problem Statement Write a function “ feet->inches ” which takes a length (in feet) and returns a length (in inches). $200 - Step 3 Contract+Purpose Statement ; feet->inches : Number -> Number ; converts the input from feet to inches
21
Data Definition: Strings like “Rasheem” and “Vinelle” Data Definition: Strings like “Rasheem” and “Vinelle” Problem Statement Write a function ‘ hello ’, which takes in a name as input and prints out “ Hello, _____ ” for that person, filling in their name. Problem Statement Write a function ‘ hello ’, which takes in a name as input and prints out “ Hello, _____ ” for that person, filling in their name. $200 - Step 3 Contract+Purpose Statement ; hello : String -> String ; takes a name and prints “Hello, <name>”
22
Data Definition: Numbers like 20, 567, 0, 18 Data Definition: Numbers like 20, 567, 0, 18 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. 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. $200 - Step 3 Contract+Purpose Statement ; tip : Number Number -> Number ; given a price and a tip percentage, return the tip amount
23
Data Definition: Numbers like 30, 54, 102 Data Definition: Numbers like 30, 54, 102 Problem Statement Write a function ‘ blue-rect ’, which takes width and height as input, and outputs a solid blue rectangle of the appropriate size. Problem Statement Write a function ‘ blue-rect ’, which takes width and height as input, and outputs a solid blue rectangle of the appropriate size. $200 - Step 3 Contract+Purpose Statement ; blue-rect : Number Number -> Image ; draws a blue rectangle of the correct size Contract+Purpose Statement ; blue-rect : Number Number -> Image ; draws a blue rectangle of the correct size
24
Data Definition: Numbers like 30, 574, 102 Data Definition: Numbers like 30, 574, 102 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. 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. $200 - Step 3 Contract+Purpose Statement ; 3digits : Number -> Boolean ; returns true if the input has 3 digits
26
Data Definition: Numbers like 20, 567, 0, 18 Data Definition: Numbers like 20, 567, 0, 18 Problem Statement Write a function ‘ triple ’, which takes in a number as input and outputs a number three times its size. Problem Statement Write a function ‘ triple ’, which takes in a number as input and outputs a number three times its size. $300 - Step 4 Contract+Purpose Statement ; triple : Number -> Number ; multiplies the input by 3 Contract+Purpose Statement ; triple : Number -> Number ; multiplies the input by 3 Examples ; (triple 5) => 15 Examples ; (triple 5) => 15
27
Data Definition: Numbers like 20, 567, 0, 18 Data Definition: Numbers like 20, 567, 0, 18 Problem Statement Write a function “ feet->inches ” which takes a length (in feet) and returns a length (in inches). Problem Statement Write a function “ feet->inches ” which takes a length (in feet) and returns a length (in inches). $300 - Step 4 Contract+Purpose Statement ; feet->inches : Number -> Number ; converts the input from feet to inches Examples ; (feet->inches 6) => 75 Examples ; (feet->inches 6) => 75
28
Data Definition: Strings like “Rasheem” and “Vinelle” Data Definition: Strings like “Rasheem” and “Vinelle” Problem Statement Write a function ‘ hello ’, which takes in a name as input and prints out “ Hello, _____ ” for that person, filling in their name. Problem Statement Write a function ‘ hello ’, which takes in a name as input and prints out “ Hello, _____ ” for that person, filling in their name. $300 - Step 4 Contract+Purpose Statement ; hello : String -> String ; takes a name and prints “Hello, ” Example ; (hello “Jose”) => “hello, Jose”
29
Data Definition: Numbers like 20, 567, 0, 18 Data Definition: Numbers like 20, 567, 0, 18 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. 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. $300 - Step 4 Contract+Purpose Statement ; tip : Number Number -> Number ; given a price and a tip percentage, return the tip amount Example: ; (tip 50 20) => 10
30
Data Definition: Numbers like 30, 54, 102 Data Definition: Numbers like 30, 54, 102 Problem Statement Write a function ‘ blue-rect ’, which takes width and height as input, and outputs a solid blue rectangle of the appropriate size. Problem Statement Write a function ‘ blue-rect ’, which takes width and height as input, and outputs a solid blue rectangle of the appropriate size. $300 - Step 4 Contract+Purpose Statement ; blue-rect : Number Number -> Image ; draws a blue rectangle of the correct size Contract+Purpose Statement ; blue-rect : Number Number -> Image ; draws a blue rectangle of the correct size Example: (blue-rect 10 40) =>
31
Data Definition: Numbers like 30, 574, 102 Data Definition: Numbers like 30, 574, 102 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. 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. $300 - Step 4 Contract+Purpose Statement ; 3digits : Number -> Boolean ; returns true if the input has 3 digits Example: ; (3digits 173) => true
33
Problem Statement Write a function ‘ triple ’, which takes in a number as input and outputs a number three times its size. Problem Statement Write a function ‘ triple ’, which takes in a number as input and outputs a number three times its size. $400 - Step 5 Contract+Purpose Statement ; triple : Number -> Number ; multiplies the input by 3 Contract+Purpose Statement ; triple : Number -> Number ; multiplies the input by 3 Examples ; (triple 5) => 15 Examples ; (triple 5) => 15 (define (triple x) …function body…)
34
Problem Statement Write a function “ feet->inches ” which takes a length (in feet) and returns a length (in inches). Problem Statement Write a function “ feet->inches ” which takes a length (in feet) and returns a length (in inches). $400 - Step 5 Contract+Purpose Statement ; feet->inches : Number -> Number ; converts the input from feet to inches Examples ; (feet->inches 6) => 75 Examples ; (feet->inches 6) => 75 (define (feet->inches f) …function body…)
35
Problem Statement Write a function ‘ hello ’, which takes in a name as input and prints out “ Hello, _____ ” for that person, filling in their name. Problem Statement Write a function ‘ hello ’, which takes in a name as input and prints out “ Hello, _____ ” for that person, filling in their name. $400 - Step 5 Contract+Purpose Statement ; hello : String -> String ; takes a name and prints “Hello, ” Example ; (hello “Jose”) => “hello, Jose” (define (hello name) …function body…)
36
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. 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. $400 - Step 5 Contract+Purpose Statement ; tip : Number Number -> Number ; given a price and a tip percentage, return the tip amount Example: ; (tip 50 20) => 10 (define (tip total percent) …function body…)
37
Problem Statement Write a function ‘ blue-rect ’, which takes width and height as input, and outputs a solid blue rectangle of the appropriate size. Problem Statement Write a function ‘ blue-rect ’, which takes width and height as input, and outputs a solid blue rectangle of the appropriate size. $400 - Step 5 Contract+Purpose Statement ; blue-rect : Number Number -> Image ; draws a blue rectangle of the correct size Contract+Purpose Statement ; blue-rect : Number Number -> Image ; draws a blue rectangle of the correct size Example: (blue-rect 10 40) => (define (blue-rect x y) …function body…)
38
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. 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. $400 - Step 5 Contract+Purpose Statement ; 3digits : Number -> Boolean ; returns true if the input has 3 digits Example: ; (3digits 173) => true (define (3digits 543) …function body…)
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.