Title: Design Recipe Team Challenge!
1Design Recipe Team Challenge!
2The rules
- Every team submits their answer in writing.
- Every team can gain points for every question.
- Wrong answers are worth 50. Wild guesses and
blank answers are worth 0! - Each round is worth more money!
3Design 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
4100 - Step 2
- Problem Statement
- Write a function triple, which takes in a
number as input and outputs a number three times
its size.
5100 - 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
6100 - 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).
7100 - 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
8100 - 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.
9100 - 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
10100 - 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)
11100 - 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
12100 - 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
13100 - 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.
14100 - 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
15100 - 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.
16100 - 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)
18200 - 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
19200 - 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
20200 - 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
21200 - 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
22200 - 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
23200 - 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)
25300 - 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
26300 - 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
27300 - 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
28300 - 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
29300 - 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
30300 - 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)
32400 - 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)
33400 - 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)
34400 - 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)
35400 - 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)
36400 - 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)
37400 - 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)